explain (StreamingQuery)
Prints the (logical and physical) plans to the console for debugging.
Syntax
explain(extended=False)
Parameters
Parameter | Type | Description |
|---|---|---|
| bool, optional | If |
Returns
None
Examples
Python
sdf = spark.readStream.format("rate").load()
sq = sdf.writeStream.format('memory').queryName('query_explain').start()
sq.processAllAvailable()
Print the physical plan only:
Python
sq.explain()
# == Physical Plan ==
# ...
Print all plans:
Python
sq.explain(True)
# == Parsed Logical Plan ==
# ...
# == Analyzed Logical Plan ==
# ...
# == Optimized Logical Plan ==
# ...
# == Physical Plan ==
# ...
sq.stop()