gianm commented on code in PR #14046:
URL: https://github.com/apache/druid/pull/14046#discussion_r1166190942


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java:
##########
@@ -111,14 +112,23 @@ public QueryResponse<Object[]> runQuery(final DruidQuery 
druidQuery)
     Hook.QUERY_PLAN.run(druidQuery.getQuery());
     String taskId = MSQTasks.controllerTaskId(plannerContext.getSqlQueryId());
 
-    QueryContext queryContext = plannerContext.queryContext();
-    String msqMode = MultiStageQueryContext.getMSQMode(queryContext);
+    // SQL query context: context provided by the user, and potentially 
modified by handlers during planning.
+    // Does not directly influence task execution, but it does form the basis 
for the initial native query context,
+    // which *does* influence task execution.
+    final QueryContext sqlQueryContext = plannerContext.queryContext();
+
+    // Query context overrides: things that we add to the native query context 
prior to creating a controller task.
+    // These influence task execution.
+    final Map<String, Object> queryContextOverrides = new HashMap<>();
+
+    final String msqMode = MultiStageQueryContext.getMSQMode(sqlQueryContext);
     if (msqMode != null) {
-      MSQMode.populateDefaultQueryContext(msqMode, 
plannerContext.queryContextMap());
+      MSQMode.populateDefaultQueryContext(msqMode, queryContextOverrides);

Review Comment:
   Hmm, good point. I was intending to preserve the old behavior. I adjusted 
this to make it so specific properties override the mode (as was the previous 
behavior) and added a test case to `MSQWarningsTest`.



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