Akshat-Jain commented on code in PR #17443:
URL: https://github.com/apache/druid/pull/17443#discussion_r1832154434


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/DataSourcePlan.java:
##########
@@ -413,15 +418,25 @@ private static DataSourcePlan forLookup(
   private static DataSourcePlan forQuery(
       final QueryKitSpec queryKitSpec,
       final QueryDataSource dataSource,
+      final QueryContext queryContext,

Review Comment:
   > Like the most obvious question is how is 
datasource.getQuery().getCOntext() different from queryContext. That nuance is 
hard to reason about when a person is writing an implementation.
   
   @cryptoe Yeah, I fully agree, I was also confused on this.
   
   The problem seems to be that wherever we do 
`query.withOverriddenContext(some context overrides)`, the context overrides 
are applied only to the top-level-query, not to all the nested `Query` objects 
within the query-datasource-query-chains.
   
   I'm not sure if the above is the "only" thing leading to the mismatched 
context maps, but it's definitely one of the reasons.
   
   I'm not sure if it's intentional, but maybe it is? For example, we add a 
`scanSignature` key to ScanQuery object, and it doesn't make sense to pass it 
to all the nested Query objects. So maybe the design originally stemmed from 
such requirements? (Not sure though, I'm lacking the historic context behind 
this design choice)
   
   Thoughts?



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