[multistage] Add Support for Inferring Invalid Segment Partition Id#15760
Merged
itschrispeck merged 4 commits intoapache:masterfrom May 10, 2025
Merged
[multistage] Add Support for Inferring Invalid Segment Partition Id#15760itschrispeck merged 4 commits intoapache:masterfrom
itschrispeck merged 4 commits intoapache:masterfrom
Conversation
134749c to
d5280dc
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15760 +/- ##
============================================
+ Coverage 62.90% 63.25% +0.35%
- Complexity 1386 1388 +2
============================================
Files 2867 2888 +21
Lines 163354 165241 +1887
Branches 24952 25259 +307
============================================
+ Hits 102755 104524 +1769
+ Misses 52847 52826 -21
- Partials 7752 7891 +139
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:
|
itschrispeck
approved these changes
May 9, 2025
...java/org/apache/pinot/query/planner/physical/v2/opt/rules/LeafStageWorkerAssignmentRule.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/utils/config/QueryOptionsUtils.java
Outdated
Show resolved
Hide resolved
wirybeaver
reviewed
May 9, 2025
...-planner/src/main/java/org/apache/pinot/query/planner/physical/v2/PRelNodeTreeValidator.java
Show resolved
Hide resolved
wirybeaver
reviewed
May 9, 2025
...java/org/apache/pinot/query/planner/physical/v2/opt/rules/LeafStageWorkerAssignmentRule.java
Show resolved
Hide resolved
shauryachats
reviewed
May 9, 2025
...java/org/apache/pinot/query/planner/physical/v2/opt/rules/LeafStageWorkerAssignmentRule.java
Outdated
Show resolved
Hide resolved
shauryachats
reviewed
May 9, 2025
...java/org/apache/pinot/query/planner/physical/v2/opt/rules/LeafStageWorkerAssignmentRule.java
Outdated
Show resolved
Hide resolved
MeihanLi
reviewed
May 10, 2025
...-planner/src/main/java/org/apache/pinot/query/planner/physical/v2/PRelNodeTreeValidator.java
Outdated
Show resolved
Hide resolved
Contributor
|
lgtm |
shauryachats
approved these changes
May 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
For Realtime streams, there can be scenarios where a very small percentage of records will be incorrectly assigned to a Stream Partition (when partitioning by a key is enabled).
In such a case, the Physical Optimizer will assume the Table Scan to be un-partitioned.
This is an overkill for some use-cases, where minute errors (e.g. <0.0001%) are acceptable.
This PR adds a query option to enable this feature. The behavior is that we will infer the partition of the segment based on its name. This only works with Realtime segments since for offline segments batch ingestion should be easily able to guarantee that the partitioning is done correctly. (we also don't have a standard way to infer a partition in that case)
I have also added some metrics which were missing with the Physical Optimizer (join count, window count, etc.). These were emitted in
RelToPlanNodeConverter. I now instead do it in a centralized place so we can also emit more metrics in the future.Testing
Added UTs for Leaf Stage worker assignment. We are also testing this out in one of our bigger clusters.