You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "yashmayya (via GitHub)" <gi...@apache.org> on 2026/08/06 17:22:11 UTC
[PR] Support broker segment pruning for colocated joins [pinot]
yashmayya opened a new pull request, #19174:
URL: https://github.com/apache/pinot/pull/19174
Follow-up to #19166, which reduced a colocated join to the partition classes that hold data. This does the same for the classes that a filter empties, so a filtered colocated join runs on fewer workers and reaches fewer servers.
Only the default (logical) MSE planner is affected. The V2 physical optimizer already derives its partitions from a pruned routing table.
## What this enables
A colocated join over two partitioned tables, with a filter on the partition key:
```sql
SELECT /*+ joinOptions(is_colocated_by_join_keys='true') */ l.key, r.value
FROM left /*+ tableOptions(partition_key='key', partition_size='8', partition_function='Modulo') */ l
JOIN right /*+ tableOptions(partition_key='key', partition_size='8', partition_function='Modulo') */ r
ON l.key = r.key
WHERE l.key IN (1, 2) AND r.key IN (1, 2)
```
Both sides prune every partition class except 1 and 2. The group drops the rest. The result:
- **Fewer workers.** Each leaf runs 2 workers instead of 8.
- **Fewer servers.** The broker dispatches only to the servers that hold classes 1 and 2. It also waits on only those servers, so the query loses the tail latency of the servers it skips.
- **Fewer segments.** Each worker scans only its own class.
- **A cheaper cancel.** Cancellation reaches the same reduced server set.
These cases get the reduction:
- A filter on the partition key, written on both sides.
- A filter on the partition key on one side, when Calcite carries it to the other side through the join equality.
- A partition class that neither table populates. #19166 already dropped these.
The 1-to-1 exchange survives the reduction. Every leaf of the group keeps one worker per surviving class, in the same order, so worker `k` means the same class on every side.
## What this does not help
The common case is in this list, so it is worth stating plainly.
- **A time filter.** The time pruner removes segments, not partitions. A table partitioned by key and segmented by time holds every time range in every partition. This is the most common filter in Pinot, and it buys nothing here.
- **A filter on one side only.** A class survives while any member of the group still holds a matching row. An unfiltered side keeps every class it populates. See the trade-off below.
- **A table without `segmentPrunerTypes: ["partition"]`.** Pinot builds the partition pruner only when the routing config asks for it. Without it, nothing is pruned.
- **A filter that matches nothing.** The group keeps every populated class. A group with zero workers has nothing to wire a 1-to-1 exchange to, and the servers return the same empty result anyway.
- **The probe leaf of a colocated semi-join.** That leaf holds the join, so the routing-query builder cannot fold it.
- **A non-colocated stage above the join, with the default config.** `getCandidateServersPerTables` ignores the query and expands the dispatched set again. With `useLeafServerForIntermediateStage=true`, the reduction carries upward.
## Trade-offs
**A class drops only when every member of the group prunes it.** The alternative is to drop a class as soon as one side prunes it. That is wrong for a RIGHT join, a FULL join, a union, and an anti-join. In each of those, the other side still produces rows. The union rule needs no knowledge of the operator above. A new colocated operator therefore cannot break it in silence. The cost is the one-sided filter case above.
**A surviving class dispatches all of its segments on every member.** A member whose own filter excludes them still scans them. The server-side filter removes them again. This keeps the class on the same server it uses without pruning, so the exchange stays in process. A finer verdict inside a surviving class is possible later.
**Planning costs one routing call per member.** Only a leaf that carries a filter pays it. The result is cached per fragment, so the leaf assignment reuses it.
## A sound proof of emptiness
The old verdict read "this partition is pruned" from the absence of its segments in the routing table. Absence has innocent causes. Instance selection can class a segment as optional. The server that holds a segment can leave the enabled server map. A segment can enter the partition metadata before it becomes selectable. Each of these loses matching rows.
This adds a planner-only entry point that reports which segments the pruners **pruned**:
```java
// RoutingManager, added as a default that proves nothing, so no implementation breaks
@Nullable Set<String> getPrunedSegments(BrokerRequest brokerRequest);
```
Only presence in that set is a proof. Instance selection takes no part and there is no request id, so two leaves over one table and one filter cannot disagree. `MultiClusterRoutingManager` combines the set by intersection, because a proof holds only when every cluster that can route the segment pruned it.
The ordinary partitioned leaf now uses the same proof. That path is strictly more conservative than before.
## How to turn it off
No new flag. The query option `useBrokerPruning` and the broker config `pinot.broker.multistage.logical.planner.use.broker.pruning` already do it. With pruning off, every populated class keeps its worker, which is the behavior of #19166.
## Tests
- `WorkerManagerTest` covers both sides pruning and one side pruning. It also covers the all-pruned fallback, an unavailable segment, a routing failure and the kill switch. Two more cases cover padding together with reduction, and a self-join whose sides prune different classes.
- `BrokerRoutingManagerTest` and `MultiClusterRoutingManagerTest` cover the pruned set and the multi-cluster intersection.
- `ColocatedJoinEmptyPartitionTest` runs the filtered join end to end. It proves the 1-to-1 wiring at the reduced width. It also matches the rows against the same query without the colocation hint. A filter that matches nothing returns an empty result.
The integration fixture had no `RoutingConfig`, so it built no partition pruner. This adds one. Without it a filtered assertion proves nothing.
## Notes
- Depends on #19166.
- Includes the pre-partitioned leaf guard from #19173. Review that one first.
- The dispatched server count does not move in the integration cluster. It runs 2 servers with `numReplicas 2`, so both servers hold every segment. The end-to-end tests assert worker count, segments queried, fan-out and receiver ids. `WorkerManagerTest` asserts the dispatched server set.
- A worker with no segments on an upsert table can still acquire newly-added segments, so it does not always scan nothing. This predates the change and is filed separately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Support broker segment pruning for colocated joins [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19174:
URL: https://github.com/apache/pinot/pull/19174#issuecomment-5209609839
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/19174?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `28.57143%` with `415 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 38.91%. Comparing base ([`14333f3`](https://app.codecov.io/gh/apache/pinot/commit/14333f3f927b165caa9affa8ff656ca5aa9c86d9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`653aa15`](https://app.codecov.io/gh/apache/pinot/commit/653aa154c8a8ecdb416031064a6ec3f5472dd68f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 6 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/19174?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [.../org/apache/pinot/query/routing/WorkerManager.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Frouting%2FWorkerManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcm91dGluZy9Xb3JrZXJNYW5hZ2VyLmphdmE=) | 5.52% | [303 Missing and 5 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...e/pinot/query/routing/ColocationGroupAnalyzer.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Frouting%2FColocationGroupAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcm91dGluZy9Db2xvY2F0aW9uR3JvdXBBbmFseXplci5qYXZh) | 50.45% | [44 Missing and 10 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...apache/pinot/query/routing/LeafPartitionHints.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Frouting%2FLeafPartitionHints.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcm91dGluZy9MZWFmUGFydGl0aW9uSGludHMuamF2YQ==) | 0.00% | [29 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ery/planner/physical/MailboxAssignmentVisitor.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Fplanner%2Fphysical%2FMailboxAssignmentVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcGxhbm5lci9waHlzaWNhbC9NYWlsYm94QXNzaWdubWVudFZpc2l0b3IuamF2YQ==) | 36.36% | [5 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...e/routing/TablePartitionReplicatedServersInfo.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Frouting%2FTablePartitionReplicatedServersInfo.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yb3V0aW5nL1RhYmxlUGFydGl0aW9uUmVwbGljYXRlZFNlcnZlcnNJbmZvLmphdmE=) | 42.85% | [3 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...not/query/routing/PlanNodeRoutingQueryBuilder.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Frouting%2FPlanNodeRoutingQueryBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcm91dGluZy9QbGFuTm9kZVJvdXRpbmdRdWVyeUJ1aWxkZXIuamF2YQ==) | 50.00% | [2 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...oker/routing/manager/BaseBrokerRoutingManager.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fbroker%2Frouting%2Fmanager%2FBaseBrokerRoutingManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9tYW5hZ2VyL0Jhc2VCcm9rZXJSb3V0aW5nTWFuYWdlci5qYXZh) | 89.65% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ery/planner/physical/DispatchablePlanMetadata.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Fplanner%2Fphysical%2FDispatchablePlanMetadata.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcGxhbm5lci9waHlzaWNhbC9EaXNwYXRjaGFibGVQbGFuTWV0YWRhdGEuamF2YQ==) | 50.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...mentpartition/SegmentPartitionMetadataManager.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fbroker%2Frouting%2Fsegmentpartition%2FSegmentPartitionMetadataManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9zZWdtZW50cGFydGl0aW9uL1NlZ21lbnRQYXJ0aXRpb25NZXRhZGF0YU1hbmFnZXIuamF2YQ==) | 91.66% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../org/apache/pinot/core/routing/RoutingManager.java](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Frouting%2FRoutingManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yb3V0aW5nL1JvdXRpbmdNYW5hZ2VyLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| ... and [1 more](https://app.codecov.io/gh/apache/pinot/pull/19174?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
> :exclamation: There is a different number of reports uploaded between BASE (14333f3) and HEAD (653aa15). Click for more details.
>
> <details><summary>HEAD has 16 uploads less than BASE</summary>
>
>| Flag | BASE (14333f3) | HEAD (653aa15) |
>|------|------|------|
>|unittests1|1|0|
>|unittests|2|1|
>|java-25|5|1|
>|temurin|5|1|
>|integration|3|0|
>|integration1|1|0|
>|integration2|1|0|
>|custom-integration1|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #19174 +/- ##
=============================================
- Coverage 66.57% 38.91% -27.66%
+ Complexity 1423 1416 -7
=============================================
Files 3441 3445 +4
Lines 218320 219042 +722
Branches 34737 34909 +172
=============================================
- Hits 145341 85235 -60106
- Misses 61251 126028 +64777
+ Partials 11728 7779 -3949
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-25](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.91% <28.57%> (-27.66%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.91% <28.57%> (-27.66%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.91% <28.57%> (-27.66%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/19174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.91% <28.57%> (+0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/pinot/pull/19174?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Support broker segment pruning for colocated joins [pinot]
Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on code in PR #19174:
URL: https://github.com/apache/pinot/pull/19174#discussion_r3810913649
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/routing/PlanNodeRoutingQueryBuilder.java:
##########
@@ -85,6 +85,27 @@ public static PinotQuery createPinotQueryForRouting(String tableName, PlanNode l
return pinotQuery;
}
+ /// Whether [#createPinotQueryForRouting] can fold the given leaf stage tree, i.e. whether it holds no multi-input
+ /// node. Lets a caller skip the attempt rather than pay a thrown-and-caught exception per query, which a colocated
+ /// semi-join's probe leaf -- the one holding the join -- would otherwise do on every query. It lives here so that it
+ /// walks the tree the same way [#accumulateBottomToTop] does; the two disagreeing would either bring the exception
+ /// back or, worse, silently refuse shapes that fold perfectly well.
+ ///
+ /// A `true` result is not a promise that the fold succeeds: the tree may still be missing a table scan, which only
+ /// the fold itself detects.
+ public static boolean canBuildRoutingQuery(PlanNode leafStageRoot) {
Review Comment:
Maybe we can add some tests and/or make it package-protected. Not blocker
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Support broker segment pruning for colocated joins [pinot]
Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #19174:
URL: https://github.com/apache/pinot/pull/19174
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Support broker segment pruning for colocated joins [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19174:
URL: https://github.com/apache/pinot/pull/19174#issuecomment-5415718084
Documentation follow-up: https://github.com/pinot-contrib/pinot-docs/pull/1004 (merged).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Support broker segment pruning for colocated joins [pinot]
Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on code in PR #19174:
URL: https://github.com/apache/pinot/pull/19174#discussion_r3812402122
##########
pinot-query-planner/src/test/resources/queries/ExplainPhysicalPlans.json:
##########
@@ -421,21 +421,15 @@
"\n ├── [2]@localhost:1|[1] PROJECT",
"\n │ └── [2]@localhost:1|[1] TABLE SCAN (a) null",
"\n └── [2]@localhost:1|[1] MAIL_RECEIVE(BROADCAST_DISTRIBUTED)",
- "\n ├── [3]@localhost:2|[2] MAIL_SEND(BROADCAST_DISTRIBUTED)->{[2]@localhost:1|[0, 1],[2]@localhost:2|[2, 3]} (Subtree Omitted)",
- "\n ├── [3]@localhost:2|[3] MAIL_SEND(BROADCAST_DISTRIBUTED)->{[2]@localhost:1|[0, 1],[2]@localhost:2|[2, 3]} (Subtree Omitted)",
- "\n ├── [3]@localhost:1|[0] MAIL_SEND(BROADCAST_DISTRIBUTED)->{[2]@localhost:1|[0, 1],[2]@localhost:2|[2, 3]} (Subtree Omitted)",
- "\n └── [3]@localhost:1|[1] MAIL_SEND(BROADCAST_DISTRIBUTED)->{[2]@localhost:1|[0, 1],[2]@localhost:2|[2, 3]}",
- "\n └── [3]@localhost:1|[1] PROJECT",
- "\n └── [3]@localhost:1|[1] FILTER",
- "\n └── [3]@localhost:1|[1] AGGREGATE_FINAL",
- "\n └── [3]@localhost:1|[1] MAIL_RECEIVE(HASH_DISTRIBUTED)",
- "\n ├── [4]@localhost:2|[2] MAIL_SEND(HASH_DISTRIBUTED)[PARTITIONED]->{[3]@localhost:2|[2]} (Subtree Omitted)",
- "\n ├── [4]@localhost:2|[3] MAIL_SEND(HASH_DISTRIBUTED)[PARTITIONED]->{[3]@localhost:2|[3]} (Subtree Omitted)",
- "\n ├── [4]@localhost:1|[0] MAIL_SEND(HASH_DISTRIBUTED)[PARTITIONED]->{[3]@localhost:1|[0]} (Subtree Omitted)",
- "\n └── [4]@localhost:1|[1] MAIL_SEND(HASH_DISTRIBUTED)[PARTITIONED]->{[3]@localhost:1|[1]}",
- "\n └── [4]@localhost:1|[1] AGGREGATE_LEAF",
- "\n └── [4]@localhost:1|[1] FILTER",
- "\n └── [4]@localhost:1|[1] TABLE SCAN (b) null",
+ "\n └── [3]@localhost:1|[0] MAIL_SEND(BROADCAST_DISTRIBUTED)->{[2]@localhost:1|[0, 1],[2]@localhost:2|[2, 3]}",
+ "\n └── [3]@localhost:1|[0] PROJECT",
+ "\n └── [3]@localhost:1|[0] FILTER",
+ "\n └── [3]@localhost:1|[0] AGGREGATE_FINAL",
+ "\n └── [3]@localhost:1|[0] MAIL_RECEIVE(HASH_DISTRIBUTED)",
+ "\n └── [4]@localhost:1|[0] MAIL_SEND(HASH_DISTRIBUTED)[PARTITIONED]->{[3]@localhost:1|[0]}",
Review Comment:
This expectation moving is worth a line in the description, because the reduction here isn't actually a pruning verdict. `FakeRoutingManager` doesn't override `getPrunedSegments`, so it returns the interface default `Set.of()` — "a filter ran and proved nothing" — and `QueryEnvironmentTestBase` builds partitions 1..3 of `b` as non-null `PartitionInfo`s with empty segment lists, so `allSegmentsPruned` is vacuously true for them and only class 0 survives.
The new plan is correct — those classes hold no rows, and the old one spent three workers on nothing. Two things follow:
- Production can't reach that state: `SegmentPartitionMetadataManager` only creates a partition entry together with its first segment. So `populatedClasses` (non-null `PartitionInfo`) and `matchingClasses` (some segment not provably pruned) agree everywhere *except* in this fixture. A sentence on `markClassesWithMatchingData` noting the two use different notions of "holds data" would save the next reader the trip.
- This file is the only place in the diff where a single-partitioned-leaf group — a leaf plus its 1-to-1 parent, no join — shows up being reduced, and it does so for a fixture reason. Since `toReducibleGroup` needs only one partitioned leaf, plain partitioned aggregations feeding a pre-partitioned exchange are in scope too, which the current description ("colocated joins") undersells.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org