In pyspark, running:
sdf = sqlContext.sql("""SELECT * FROM t1 JOIN t2 on t1.c1 = t2.c1 """)
and then:
sdf.explain(extended=True)
it prints the logical and physical plans of the query execution.
My question is: How can I capture the output in a variable, instead of printing it?
v = sdf.explain(extended=True) naturally, does not work