jihoonson commented on a change in pull request #10041:
URL: https://github.com/apache/druid/pull/10041#discussion_r442534163



##########
File path: 
server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java
##########
@@ -187,10 +198,15 @@ public ClientQuerySegmentWalker(
   @Override
   public <T> QueryRunner<T> getQueryRunnerForSegments(Query<T> query, 
Iterable<SegmentDescriptor> specs)
   {
-    // Inlining isn't done for segments-based queries.
+    // Inlining isn't done for segments-based queries, but we still globalify 
the table datasources if possible
+    final Query<T> freeTradeQuery = 
query.withDataSource(globalizeIfPossible(query.getDataSource()));
 
     if (canRunQueryUsingClusterWalker(query)) {
-      return decorateClusterRunner(query, 
clusterClient.getQueryRunnerForSegments(query, specs));
+      return new QuerySwappingQueryRunner<>(
+          decorateClusterRunner(freeTradeQuery, 
clusterClient.getQueryRunnerForSegments(query, specs)),

Review comment:
       super nit: even though `query` is not used in 
`CachingClusteredClient.getQueryRunnerForSegments()`, it could be better to use 
`freeTradeQuery` instead of `query` for future proof for when someone changes 
the logic of `CachingClusteredClient.getQueryRunnerForSegments()`.




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

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