maytasm commented on code in PR #19654:
URL: https://github.com/apache/druid/pull/19654#discussion_r3521794557


##########
server/src/main/java/org/apache/druid/server/QueryLifecycle.java:
##########
@@ -212,43 +226,64 @@ public void after(final boolean isDone, final Throwable 
thrown)
    * @throws DruidException if the current state is not NEW, which indicates a 
bug
    */
   public void initialize(final Query<?> baseQuery)
+  {
+    initialize(baseQuery, null);
+  }
+
+  /**
+   * As {@link #initialize(Query)}, but takes the keys the caller set in the 
context. Pass {@code null} to treat the
+   * whole context as caller-set (native queries). The SQL layer merges static 
defaults into the context, so it must
+   * pass the real user-provided keys.
+   *
+   * @throws DruidException if the current state is not NEW, which indicates a 
bug
+   */
+  public void initialize(final Query<?> baseQuery, @Nullable final Set<String> 
userProvidedContextKeys)
   {
     transition(State.NEW, State.INITIALIZED);
 
     userContextKeys = new HashSet<>(baseQuery.getContext().keySet());
+    final Set<String> effectiveUserKeys =

Review Comment:
   nit: since it's not really clear from the variable names (`userContextKeys` 
vs `userProvidedContextKeys`), can you add a comment here on the difference 
between userContextKeys and userProvidedContextKeys



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