Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16958] [SQL] Reuse subqueries within the same query - #14548
[SPARK-16958] [SQL] Reuse subqueries within the same query#14548davies wants to merge 4 commits into
Conversation
SparkQA
commented
Aug 9, 2016
Test build #63389 has finished for PR 14548 at commit
|
| * | ||
| * This is used to generate tree string for SparkScalarSubquery. | ||
| */ | ||
| case class SubqueryExec(name: String, child: SparkPlan) extends UnaryExecNode { |
There was a problem hiding this comment.
A large part of this class is shared with BroadcastExchangeExec. Should we try to factor out common functionality?
There was a problem hiding this comment.
I think it's OK to have some duplicated code here, over abstracted code is actually harder to read.
hvanhovell
commented
Aug 10, 2016
@davies this looks pretty good. I am very excited about the SparkPlan clean-up! |
davies
commented
Aug 10, 2016
@hvanhovell Had posted an picture, check it out. |
SparkQA
commented
Aug 10, 2016
Test build #63560 has finished for PR 14548 at commit
|
SparkQA
commented
Aug 11, 2016
Test build #63563 has finished for PR 14548 at commit
|
hvanhovell
commented
Aug 11, 2016
Cool picture! |
hvanhovell
commented
Aug 11, 2016
LGTM |
davies
commented
Aug 11, 2016
Merging it into master, thanks! |
## What changes were proposed in this pull request? this code come from PR: #11190, but this code has never been used, only since PR: #14548, Let's continue fix it. thanks. ## How was this patch tested? N / A Closes#23227 from heary-cao/unuseSparkPlan. Authored-by: caoxuewen <cao.xuewen@zte.com.cn> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
JkSelf
commented
Jan 16, 2019
@davies@hvanhovell@gatorsmile But in deed, the stage of same subquery execute maybe not once as following: |
hvanhovell
commented
Jan 16, 2019
@JkSelf can you file a JIRA ticket? |
JkSelf
commented
Jan 17, 2019
@hvanhovell , Thanks for your help and I have filed Jira 26639. |
## What changes were proposed in this pull request? this code come from PR: apache#11190, but this code has never been used, only since PR: apache#14548, Let's continue fix it. thanks. ## How was this patch tested? N / A Closesapache#23227 from heary-cao/unuseSparkPlan. Authored-by: caoxuewen <cao.xuewen@zte.com.cn> Signed-off-by: Wenchen Fan <wenchen@databricks.com>


What changes were proposed in this pull request?
There could be multiple subqueries that generate same results, we could re-use the result instead of running it multiple times.
This PR also cleanup up how we run subqueries.
For SQL query
The explain is
The visualized plan:
How was this patch tested?
Existing tests.