-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-32717][SQL] Add a AQEOptimizer for AdaptiveSparkPlanExec #29559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@cloud-fan @maryannxue Please take a look, thanks! |
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEOptimizer.scala
Outdated
Show resolved
Hide resolved
|
Test build #127955 has finished for PR 29559 at commit
|
|
Test build #127956 has finished for PR 29559 at commit
|
| val ADAPTIVE_OPTIMIZER_EXCLUDED_RULES = | ||
| buildConf("spark.sql.adaptive.optimizer.excludedRules") | ||
| .doc("Configures a list of rules to be disabled in the adaptive optimizer, in which the " + | ||
| "rules are specified by their rule names and separated by comma. The optimizer will log " + | ||
| "the rules that have indeed been excluded.") | ||
| .version("3.1.0") | ||
| .stringConf | ||
| .createOptional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why we need to introduce a config for user to disable rule in AQE? Is there a use case we are considering now? I am seeing spark.sql.optimizer.excludedRules was introduced to work around https://issues.apache.org/jira/browse/SPARK-24624 (#21764 (comment)), but not sure what's the use case here for AQE.
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
|
@c21 @maropu Thank you for your comments. |
|
yea, adding it itself looks okay to me. |
|
@Ngone51 - thanks, the rationale for developer makes sense to me. |
|
Thanks, I've added a unit test and updated the PR description for the rule excluding configuration. |
|
Test build #127991 has finished for PR 29559 at commit
|
|
Merged to master. |
|
thanks all! |
What changes were proposed in this pull request?
This PR proposes to add a specific
AQEOptimizerfor theAdaptiveSparkPlanExecinstead of implementing an anonymousRuleExecutor. At the same time, this PR also adds the configurationspark.sql.adaptive.optimizer.excludedRules, which follows the same pattern ofOptimizer, to make theAQEOptimizermore flexible for users and developers.Why are the changes needed?
Currently,
AdaptiveSparkPlanExechas implemented an anonymousRuleExecutorto apply the AQE optimize rules on the plan. However, the anonymous class usually could be inconvenient to maintain and extend for the long term.Does this PR introduce any user-facing change?
No.
How was this patch tested?
It's a pure refactor so pass existing tests should be ok.