xiangfu0 commented on code in PR #18665:
URL: https://github.com/apache/pinot/pull/18665#discussion_r3366170970


##########
pinot-materialized-view/src/main/java/org/apache/pinot/materializedview/executor/GrpcMaterializedViewQueryExecutor.java:
##########
@@ -219,6 +219,18 @@ private void decodeNextFrame() {
     }
   }
 
+  /// Prefixes a `SET enableMaterializedViewRewrite = 'false'` statement onto 
the materialization
+  /// query.  The query reads the base table, and with broker-wide MV rewrite 
enabled it would
+  /// otherwise be eligible to be rewritten back onto an MV over the same base 
table (its own MV or
+  /// a sibling), which would build the MV from MV data instead of the base 
table.  The opt-out is
+  /// honored from user input (it only forgoes an optimization, never changes 
results), so a plain
+  /// SET prefix is sufficient.
+  @VisibleForTesting
+  static String disableMaterializedViewRewrite(String sql) {

Review Comment:
   Addressed in the latest revision. The minion no longer prepends a `SET 
enableMaterializedViewRewrite='false'` (which a duplicate option already in the 
materialization SQL would override — a SQL `SET` wins via last-write, and 
request-level options lose to SQL via `putIfAbsent`). Instead it forces the 
flag through gRPC request **metadata**, and `BrokerGrpcServer` applies it as an 
unconditional override on the parsed query options **after** parsing, so it 
cannot be defeated by anything in the (user-authored) `definedSQL`. Added unit 
tests in `BrokerGrpcServerTest`: the metadata override beats a SQL `SET 
...='true'`, and the SQL option is left untouched when the flag is absent.



-- 
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]

Reply via email to