imply-cheddar commented on code in PR #17354:
URL: https://github.com/apache/druid/pull/17354#discussion_r1824602908


##########
server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java:
##########
@@ -175,9 +178,27 @@ public ClientQuerySegmentWalker(
   }
 
   @Override
-  public <T> QueryRunner<T> getQueryRunnerForIntervals(final Query<T> query, 
final Iterable<Interval> intervals)
+  public <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, final 
Iterable<Interval> intervals)
   {
-    final QueryToolChest<T, Query<T>> toolChest = 
warehouse.getToolChest(query);
+    final int maxSubqueryRows = 
query.context().getMaxSubqueryRows(serverConfig.getMaxSubqueryRows());
+    final String maxSubqueryMemoryString = query.context()
+                                                
.getMaxSubqueryMemoryBytes(serverConfig.getMaxSubqueryBytes());
+    final long maxSubqueryMemory = 
subqueryGuardrailHelper.convertSubqueryLimitStringToLong(maxSubqueryMemoryString);
+    final boolean useNestedForUnknownTypeInSubquery = query.context()
+                                                           
.isUseNestedForUnknownTypeInSubquery(serverConfig.isuseNestedForUnknownTypeInSubquery());

Review Comment:
   So many calls to `query.context()` here.  Whenever I see such a thing, I 
have to leave a comment saying that we should call it once, store the reference 
and reuse that.  Not sure how much it really matters, but I've left the comment 
now :P



##########
processing/src/main/java/org/apache/druid/query/AbstractQueryLogic.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query;
+
+import com.google.inject.Inject;
+
+/**
+ * Executes the query by utilizing the given walker.
+ */
+public abstract class AbstractQueryLogic implements QueryLogic
+{
+  protected QueryRunnerFactoryConglomerate conglomerate;
+
+  @Inject
+  public void initialize(QueryRunnerFactoryConglomerate conglomerate)
+  {
+    this.conglomerate = conglomerate;
+  }
+}

Review Comment:
   I'm not sure how much value this abstract class is really adding anymore, 
but beyond this comment, changes here don't need to block anything.



##########
processing/src/main/java/org/apache/druid/query/union/UnionQueryRunner.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.union;
+
+import org.apache.druid.java.util.common.guava.Sequence;
+import org.apache.druid.java.util.common.guava.Sequences;
+import org.apache.druid.query.Query;
+import org.apache.druid.query.QueryLogic;
+import org.apache.druid.query.QueryPlus;
+import org.apache.druid.query.QueryRunner;
+import org.apache.druid.query.QueryRunnerFactoryConglomerate;
+import org.apache.druid.query.QuerySegmentWalker;
+import org.apache.druid.query.ToolChestBasedResultSerializedRunner;
+import org.apache.druid.query.context.ResponseContext;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class UnionQueryRunner implements QueryRunner<Object>

Review Comment:
   Just a thought, this could be inlined into the `UnionQueryLogic` class 
pretty easily.  It's really six-of-one, half-dozen-of-another, but 
`UnionQueryLogic` is like, tiny and feels lonely, which is the only reason I 
commented :)



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