-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow sorting by aggregated groups #3280
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3280 +/- ##
==========================================
+ Coverage 85.84% 85.92% +0.07%
==========================================
Files 291 294 +3
Lines 52981 53470 +489
==========================================
+ Hits 45484 45946 +462
- Misses 7497 7524 +27
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Looks great to me
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.
Thanks @isidentical and @Dandandan
Benchmark runs are scheduled for baseline = 7dedcb1 and contender = 256ea91. 256ea91 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2360.
Rationale for this change
It seems like we used to only collect column references from the actual aggregate expressions, not the grouped expressions. This PR changes the processing of
rewrite_sort_col_by_aggs
to also include that fact.What changes are included in this PR?
Expression rewriter inside
rewrite_sort_col_by_aggs
now considers both distinct grouping expressions (e.g.GROUP BY <something>
) as well as regular aggregate expressions when looking for a rewrite.This PR also includes another change which corrects the behaviour of
add_missing_columns
when it is re-building theProjection
. We used to ignore applying the alias to the field qualifiers in the schema, but with this patch that is also fixed (needed by the testsql::explain_analyze::explain_analyze_baseline_metrics
).Are there any user-facing changes?
This is a bug fix.