fix(cubesql): Fix grouped join SQL push down regressions#11049
Conversation
Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com>
|
Claude finished @MazterQyou's task in 57s —— View job Code ReviewVerdict: LGTM — 0 high, 0 medium, 2 low. Click for details.
SummaryBoth fixes are well-scoped regressions from #10234 and the rationale in the PR body matches what's in the diff.
The merge of
Switching Tests Two regression tests reproduce the exact failures (Tableau-style grouped/grouped INNER JOIN and Sigma-style window over grouped join). The first test's negative assertion ( Minor nits (low priority, non-blocking)
Other observations
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11049 +/- ##
===========================================
+ Coverage 58.51% 83.57% +25.06%
===========================================
Files 216 256 +40
Lines 17265 78718 +61453
Branches 3524 0 -3524
===========================================
+ Hits 10102 65787 +55685
- Misses 6648 12931 +6283
+ Partials 515 0 -515
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Check List
Description of Changes Made
This PR fixes two regressions introduced by grouped-grouped join push down (#10234):
Join condition was rendered without applying column remapping. Join
inputs rename their columns to generated aliases, so the ON clause
referenced columns that don't exist in the aliased subqueries:
column t0.Customer State does not existMerge the join subquery's remapping before rendering the condition
and remap the condition expression, the same way the push-to-Cube
join path already does.
With the new join rules, plan extraction can flatten the projection
between Aggregate and CubeScan, leaving flat-name aliased group
expressions under a Window node. Window conversion then realiased
columns inside the window expression, changing its rendered name
while plans above still referenced the original name:
No field with unqualified name 'rank PARTITION BY [...] ...'Replace qualified columns inside window expressions with flat names
without realiasing: flat_name of a qualified column matches the name
of the unqualified flat column, keeping window expression names
intact.