[SPARK-38138][SQL] Materialize QueryPlan subqueries#35438
Closed
pan3793 wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-38138][SQL] Materialize QueryPlan subqueries#35438pan3793 wants to merge 2 commits intoapache:masterfrom
pan3793 wants to merge 2 commits intoapache:masterfrom
Conversation
Member
Author
Member
|
cc @maryannxue @allisonwang-db @sigmod FYI |
ulysses-you
reviewed
Feb 8, 2022
| */ | ||
| def subqueries: Seq[PlanType] = { | ||
| expressions.flatMap(_.collect { | ||
| lazy val subqueries: Seq[PlanType] = { |
Member
Author
There was a problem hiding this comment.
Thanks for tips, updated.
Contributor
There was a problem hiding this comment.
Just for education purpose: why @transient is useful here?
Member
Author
There was a problem hiding this comment.
SparkPlan is the subclass of QueryPlan, which need to be sent to executor, use @transient to reduce the memory usage of executor.
abstract class SparkPlan extends QueryPlan[SparkPlan] with Logging with Serializable
Contributor
|
cc @amaliujia |
|
Can one of the admins verify this patch? |
Member
Author
|
@cloud-fan would you please take a look? thanks |
sigmod
approved these changes
Feb 17, 2022
cloud-fan
approved these changes
Feb 18, 2022
Contributor
|
thanks, merging to master! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR propose to materialize
QueryPlan#subqueriesand pruned byPLAN_EXPRESSIONon searching to improve the SQL compile performance.Why are the changes needed?
We found a query in production that cost lots of time in optimize phase (also include AQE optimize phase) when enable DPP, the SQL pattern likes
SPARK-36444 significantly reduces the optimize time (exclude AQE phase), see detail at #35431, but there are still lots of time costs in
InsertAdaptiveSparkPlanon AQE optimize phase.Before this change, the query costs 658s, after this change only costs 65s.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UTs.