raghavyadav01 opened a new pull request, #20400: URL: https://github.com/apache/pinot/pull/20400
The V1 worker assignment calls `WorkerManager.filterLeafStageSegments`, so a subclass can narrow the segments a leaf stage scans. The V2 `LeafStageWorkerAssignmentRule` has no equivalent. A `WorkerManager` subclass that relies on the V1 hook is silently skipped when `usePhysicalOptimizer=true`, and the query scans every routed segment. This adds the same extension point for V2: - `LeafStageSegmentFilter` carries the filter on `PhysicalPlannerContext` (constructor argument, null by default). - The rule applies it right after it builds the per-worker assignment for a physical table scan. - `WorkerManager` implements it as a no-op and `QueryEnvironment` passes it in, so nothing changes unless a subclass overrides `filterLeafStageSegments(TableScanMetadata, Map)`. The contract is in the interface javadoc. An override has to keep every worker id, because the data distribution is derived from those workers before the filter runs, and it has to replace the per-worker lists instead of editing them in place. The rule checks the worker ids. Logical-table scans are not passed to the filter. Tests: `LeafStageSegmentFilterTest` checks that the default keeps every segment, that an override narrows the scan, that a filter emptying every worker plans fine, and that a filter dropping a worker is rejected. With the rule's call disabled the narrowing test fails (`expected [c2] but got [c3, c1, c2]`). The full `pinot-query-planner` suite passes. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
