Uh oh!
There was an error while loading. Please reload this page.
[SPARK-15438] [SQL] improve explain of whole stage codegen - #13204
[SPARK-15438] [SQL] improve explain of whole stage codegen#13204davies wants to merge 2 commits into
Conversation
davies
commented
May 19, 2016
davies
commented
May 19, 2016
Another proposal is to have a special prefix for the operators that are part of whole stage codegen. |
SparkQA
commented
May 19, 2016
Test build #58910 has finished for PR 13204 at commit
|
yucai
commented
May 20, 2016
Hi Davis, In your comments "Hopefully we do need to pay much attention on this", do you mean "we do not need to pay much attention..."? |
davies
commented
May 20, 2016
@yucai Yes, corrected, thanks! |
| override def simpleString: String = "INPUT" | ||
| override def treeChildren: Seq[SparkPlan] = Nil | ||
| override def simpleString: String = "CodegenInput" |
There was a problem hiding this comment.
Would it be better to synchronize name "CodegenInput" in simpleString with the class name InputAdapter?
yhuai
commented
May 20, 2016
I like 3. We can tell what operators are in a single WholeStageCodeGen operator and we can also know what are input operators of a WholeStageCodeGen. |
davies
commented
May 20, 2016
SparkQA
commented
May 20, 2016
Test build #58949 has finished for PR 13204 at commit
|
SparkQA
commented
May 20, 2016
Test build #3003 has finished for PR 13204 at commit
|
SparkQA
commented
May 20, 2016
Test build #3005 has finished for PR 13204 at commit
|
rxin
commented
May 20, 2016
New explain lgtm. I didn't look at the code though. |
yhuai
commented
May 20, 2016
LGTM |
rxin
commented
May 20, 2016
Merging in master/2.0. |
## What changes were proposed in this pull request? Currently, the explain of a query with whole-stage codegen looks like this ``` >>> df = sqlCtx.range(1000);df2 = sqlCtx.range(1000);df.join(pyspark.sql.functions.broadcast(df2), 'id').explain() == Physical Plan == WholeStageCodegen : +- Project [id#1L] : +- BroadcastHashJoin [id#1L], [id#4L], Inner, BuildRight, None : :- Range 0, 1, 4, 1000, [id#1L] : +- INPUT +- BroadcastExchange HashedRelationBroadcastMode(List(input[0, bigint])) +- WholeStageCodegen : +- Range 0, 1, 4, 1000, [id#4L] ``` The problem is that the plan looks much different than logical plan, make us hard to understand the plan (especially when the logical plan is not showed together). This PR will change it to: ``` >>> df = sqlCtx.range(1000);df2 = sqlCtx.range(1000);df.join(pyspark.sql.functions.broadcast(df2), 'id').explain() == Physical Plan == *Project [id#0L] +- *BroadcastHashJoin [id#0L], [id#3L], Inner, BuildRight, None :- *Range 0, 1, 4, 1000, [id#0L] +- BroadcastExchange HashedRelationBroadcastMode(List(input[0, bigint, false])) +- *Range 0, 1, 4, 1000, [id#3L] ``` The `*`before the plan means that it's part of whole-stage codegen, it's easy to understand. ## How was this patch tested? Manually ran some queries and check the explain. Author: Davies Liu <davies@databricks.com> Closes#13204 from davies/explain_codegen. (cherry picked from commit 0e70fd6) Signed-off-by: Reynold Xin <rxin@databricks.com>
Dear @davies, Sometimes, it could be hard for me to recognize the boundary of whole stage codegen, It looks easier in this way: How do you think? |
davies
commented
May 31, 2016
@yucai It's true that the case you posted is a little confusing, you can see the expected boundary on Spark UI. The other one is too verbose the see the plan (the logical parts), may not worth that. |
What changes were proposed in this pull request?
Currently, the explain of a query with whole-stage codegen looks like this
The problem is that the plan looks much different than logical plan, make us hard to understand the plan (especially when the logical plan is not showed together).
This PR will change it to:
The
*before the plan means that it's part of whole-stage codegen, it's easy to understand.How was this patch tested?
Manually ran some queries and check the explain.