xiangfu0 opened a new pull request, #18571: URL: https://github.com/apache/pinot/pull/18571
## Summary - Materialized view tables write segments per `[windowStartMs, windowEndMs)` bucket, but Pinot does not auto-enable `TimeSegmentPruner` on them today — none of the MV creation paths (controller endpoint, DDL, quickstart [airlineStatsMv_offline_table_config.json](https://github.com/apache/pinot/blob/master/pinot-tools/src/main/resources/examples/batch/airlineStatsMv/airlineStatsMv_offline_table_config.json)) set `routingConfig.segmentPrunerTypes = ["time"]`. As a result, time-range queries against an MV scan every window. - This PR auto-adds `TimeSegmentPruner` in `SegmentPrunerFactory.getSegmentPruners` when `tableConfig.isMaterializedView()` is true and the user did not explicitly list the time pruner type — mirroring the existing auto-enable pattern for `EmptySegmentPruner`. No SQL or filter-AST mutation; pure broker-side routing pruning. - Explicit user config is honored as-is: if the user listed `"time"` but the build fails (missing time column / schema), the MV branch does not silently re-attempt and mask the misconfig. ## Test plan - [x] New unit test `SegmentPrunerTest#testSegmentPrunerFactoryForMaterializedView` covers: - non-MV sanity (no auto-add) - MV with no routing config (auto-add) - MV with routing config but no `segmentPrunerTypes` (auto-add) - MV with explicit `"time"` (no double-add) - MV with partition pruner alongside (auto-added, sort order preserved: empty → time → partition) - MV REALTIME requiring `EmptySegmentPruner` (empty → time ordering preserved) - MV without a time column (silently skipped) - MV with explicit `"time"` request that fails to build (not silently re-attempted) - [x] `./mvnw spotless:check checkstyle:check license:check -pl pinot-broker` — all pass - [x] `./mvnw test-compile -pl pinot-broker` — no new warnings on changed files 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
