-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] Prune group bys and eliminate aggs by UK and FK #52201
[Enhancement] Prune group bys and eliminate aggs by UK and FK #52201
Conversation
b06c5d4
to
327a884
Compare
fnName.equals(FunctionSet.GROUP_CONCAT))) { | ||
return false; | ||
} | ||
if (!context.getSessionVariable().isEnableUKFKOpt()) { |
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.
This is a behavior change? maybe we set enable_ukfk_opt = true
by default later?
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.
Oh, this make a behavior change. Let me remove this check.
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.
Add a new session variable enable_eliminate_agg
(default is true) to avoid behaviour changed.
ColumnRefSet requiredOutputColumns = context.getTaskContext().getRequiredColumns(); | ||
List<ColumnRefOperator> groupBys = aggOp.getGroupingKeys(); | ||
|
||
// Retrieve non-UK columns from the first constraint that contains the UK column used in the GROUP BY clause. |
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.
Why only considers the first constraint, what if group by keys contain multi UKs from different tables?
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.
Good suggestions. Instead of checking the first constraint, check all the the constraints now.
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: zihe.liu <[email protected]>
8bb5913
to
5069650
Compare
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 180 / 183 (98.36%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
…cks#52201) Signed-off-by: zihe.liu <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Why I'm doing:
To enhance table pruning and aggregation elimination for more scenarios, introduce the following two rules under the enable_ukfk_opt feature:
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: