LakshSingla commented on code in PR #16800:
URL: https://github.com/apache/druid/pull/16800#discussion_r1722697872
##########
server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java:
##########
@@ -429,22 +432,18 @@ private DataSource inlineIfNecessary(
} else if (canRunQueryUsingLocalWalker(subQuery) ||
canRunQueryUsingClusterWalker(subQuery)) {
// Subquery needs to be inlined. Assign it a subquery id and run it.
- final Sequence<?> queryResults;
+ final Function<Query<T>, QueryRunner<T>> queryRunnerSupplier;
if (dryRun) {
- queryResults = Sequences.empty();
+ queryRunnerSupplier = query -> (queryPlus, responseContext) ->
Sequences.empty();
} else {
- final QueryRunner subqueryRunner = subQuery.getRunner(this);
- queryResults = subqueryRunner.run(
- QueryPlus.wrap(subQuery),
- DirectDruidClient.makeResponseContextForQuery()
- );
+ queryRunnerSupplier = query -> query.getRunner(this);
Review Comment:
The reason for it being a function was that there's a `QuerySwappingRunner`
which ensures that the query with which the runner was created is the same as
the query with which it is being run and modifying the context after creating
the runner [throws with
exception](https://github.com/apache/druid/blob/master/server/src/main/java/org/apache/druid/server/QuerySwappingQueryRunner.java#L57-L57).
The latter suggestion works, and I have modified the code to that effect.
--
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]