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


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -660,6 +660,12 @@ protected void 
prepareCompiledQueryForPlanning(QueryEnvironment.CompiledQuery co
       RequestContext requestContext, HttpHeaders httpHeaders) {
   }
 
+  /// Extension hook for preparing a stage right before the broker sends it to 
its workers, to run the query or to
+  /// explain it on the servers. Subclasses can add entries to the custom 
properties of the stage
+  /// ([DispatchablePlanFragment#getCustomProperties()]), which its workers 
get in their stage metadata.
+  protected void prepareStageForDispatch(DispatchablePlanFragment stage, 
Map<String, String> queryOptions) {

Review Comment:
   Worth stating in the Javadoc: on servers, `QueryRunner#consolidateMetadata` 
applies stage custom properties *after* the request metadata. So a key this 
hook adds silently overrides a query option or request key with the same name 
(`timeoutMs`, `trace`, etc.) for that stage's op chains. Recommending a 
namespaced key prefix would avoid accidental shadowing.



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