Uh oh!
There was an error while loading. Please reload this page.
fix: alias group_by exprs in single_distinct_to_groupby optimizer - #3305
Conversation
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
codecov-commenter
commented
Aug 31, 2022
Codecov Report
@@ Coverage Diff @@## master #3305 +/- ##
==========================================
- Coverage 85.83% 85.75% -0.09%
==========================================
Files 293 294 +1 Lines 53170 53750 +580 ==========================================
+ Hits 45637 46091 +454 - Misses 7533 7659 +126
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| ) | ||
| .unwrap(); | ||
| let grouped_agg = LogicalPlan::Aggregate(Aggregate { | ||
| let grouped_aggr = LogicalPlan::Aggregate(Aggregate { |
There was a problem hiding this comment.
Please use Aggregate::try_new here, once #3286 is merged
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
andygrove
commented
Sep 1, 2022
test failure caused by #3327 |
alamb
commented
Sep 6, 2022
Sorry for the delay in reviews -- I was out for a week and the DataFusion has been very busy |
alamb
commented
Sep 6, 2022
waynexia
commented
Sep 7, 2022
Thanks! I've reviewed 94c014e and it looks fine 👍 |
alamb
commented
Sep 7, 2022
Thanks again @waynexia |
ursabot
commented
Sep 7, 2022
Benchmark runs are scheduled for baseline = d16457a and contender = 79922b4. 79922b4 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |

Signed-off-by: Ruihang Xia waynestxia@gmail.com
Which issue does this PR close?
Closes#2994.
Rationale for this change
The original issue is apache/horaedb#59, and a minimal reproducer can be found in #2994.
This is trying to fix the
single_distinct_to_groupbyoptimizer cannot handle aGROUP BYwith an expression, likeGROUP BY c+1. To fix this, we need to alias the "original" GROUP BY in the subquery and refer to that aliased column in outer. E.g.:After optimize
What changes are included in this PR?
group_byexprsgroup_by_with_exprAre there any user-facing changes?
No