-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[multistage] Add Support for Broker Server/Segment Pruning #15959
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15959 +/- ##
============================================
+ Coverage 62.90% 63.41% +0.50%
+ Complexity 1386 1355 -31
============================================
Files 2867 2911 +44
Lines 163354 166938 +3584
Branches 24952 25533 +581
============================================
+ Hits 102755 105859 +3104
- Misses 52847 53057 +210
- Partials 7752 8022 +270
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:
|
391f9bf to
f718813
Compare
| // -------------------------------------------------------------------------- | ||
|
|
||
| public static List<Expression> convertRexNodes(List<RexExpression> rexNodes, PinotQuery pinotQuery) { | ||
| public static List<Expression> convertRexNodes(List<RexExpression> rexNodes, List<Expression> selectList) { |
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.
simplifying this code. It was taking in a wider object than required. Only access to the selectList was required
| } | ||
|
|
||
| @VisibleForTesting | ||
| static PinotQuery createPinotQuery(String tableName, TableScan tableScan, Deque<PRelNode> parents, |
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.
note for reviewers: This logic to create a PinotQuery out of a leaf stage is similar to ServerPlanRequestVisitor which is run in the servers. However, that visitor deals with PlanNode types, whereas here we deal with PRelNode.
Jackie-Jiang
left a comment
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 very useful for MSE. Is it possible to extract the code into a common util class? Maybe move the code from SSE to a util?
| // TODO(mse-physical): Consider removing this query option and making this the default, since there's already | ||
| // a table config to enable broker pruning (it is disabled by default). |
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.
Which table config are you referring to?
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.
I meant the routing. segmentPrunerTypes key in the table config. Based on my tests we don't prune segments unless this is set (maybe I am missing something)
Moved the logic to a util class. |
...uery-planner/src/main/java/org/apache/pinot/query/planner/logical/LeafStageToPinotQuery.java
Outdated
Show resolved
Hide resolved
wirybeaver
left a comment
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.
LGTM. IIUC, after applying the BrokerPruner, the Rel Trait of the Data distribution of the TableScan will be singleton so that the following Aggregation Pushdown Rule would apply the AggregateDirect.
Summary
Adds support for enabling broker pruning (for servers and segments). This can especially be beneficial for MSE Lite Mode that aims to mimic the scatter gather pattern of the V1 Engine to enable high-qps use-cases.
Test Plan
Added some unit-tests and tested on Colocated Join Quickstart. I had to add the routing config to enable partition pruning in the broker to enable this.