xiangfu0 commented on code in PR #18529:
URL: https://github.com/apache/pinot/pull/18529#discussion_r3296320465
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -798,6 +851,46 @@ protected BrokerResponse doHandleRequest(long requestId,
String query, SqlNodeAn
// Execute the query
// TODO: Replace ServerStats with ServerRoutingStatsEntry.
ServerStats serverStats = new ServerStats();
+
+ /// MV Split: attempt parallel base + materialized view queries; on
success return early, on
+ /// failure fall through to the standard non-split path with the route
restored.
+ if (materializedViewContext.isSplitRewrite()) {
Review Comment:
Good catch — fixed in `14ffcd2897` (was earlier `0433b42afe` before
subsequent reviewer iterations).
The MV SPLIT branch in `doHandleRequest` is now gated on
`materializedViewContext.isSplitRewrite() && !pinotQuery.isExplain()`, so
`EXPLAIN PLAN FOR <split-eligible-query>` falls through to the standard explain
handling (which routes to base servers without merging live data) instead of
entering `tryExecuteMaterializedViewSplit`.
Regression test `testMaterializedViewSplitSkippedForExplainQuery` in
`BaseSingleStageBrokerRequestHandlerTest` pins this: mocks a
`MaterializedViewHandler` returning a SPLIT context, asserts (a)
`executeSplit()` is never invoked, (b)
`processMaterializedViewSplitBrokerRequest` is never invoked, (c) the captured
server query routes to the base OFFLINE table.
FULL_REWRITE + EXPLAIN remains as-is intentionally — that path just swaps
the routing target for the planner to explain (no live data merge), so the
EXPLAIN naturally describes the rewritten query against the MV. Let me know if
you'd prefer FULL_REWRITE also skipped under EXPLAIN.
--
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]