[multistage] Push Collation from Exchange to Lite Mode Sort#16551
[multistage] Push Collation from Exchange to Lite Mode Sort#16551ankitsultana merged 1 commit intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16551 +/- ##
=========================================
Coverage 63.25% 63.25%
- Complexity 1362 1363 +1
=========================================
Files 3012 3012
Lines 174294 174369 +75
Branches 26684 26701 +17
=========================================
+ Hits 110244 110302 +58
- Misses 55644 55646 +2
- Partials 8406 8421 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I was wondering which phase generate the PhysicalSort(fetch=[10000]) without the collation before this PR. IIUC, the Calcite will generate the LogicalWindow Node with collocation and doesn't create a LogicalSort Node along the way. If so, it means the pinot has glitches when translate from LogicalWindow to Physical Window by wrongly inserting the PhysicalSort Node without collation. Moreover, what's the behavior of the general MSE plan? Shall we apply the same patch for non lite mode? |
wirybeaver
left a comment
There was a problem hiding this comment.
LGTM with a minor comment above.
Ankit provides the answers in slack. I pasted the explanation for future reference: The default MSE generates a SortExchange under the LogicalWindow WindowExchangeNodeInsertRule if a collation is applicable. |
Summary
Minor improvement to pushdown collation from the enclosing Exchange to the Lite Mode generated Sort.
This is good for queries like the following. Without this patch the generated Sort only has a fetch and no collation.
The plan now for this query is:
Test Plan
Added a UT and also verified on Quickstart.