abhishekagarwal87 commented on a change in pull request #11809:
URL: https://github.com/apache/druid/pull/11809#discussion_r744937413
##########
File path: processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
##########
@@ -71,19 +74,23 @@ public UnionQueryRunner(
return new MergeSequence<>(
query.getResultOrdering(),
Sequences.simple(
- Lists.transform(
- unionDataSource.getDataSources(),
- (Function<DataSource, Sequence<T>>) singleSource ->
- baseRunner.run(
- queryPlus.withQuery(
- Queries.withBaseDataSource(query, singleSource)
- // assign the subqueryId. this will be
used to validate that every query servers
- // have responded per subquery in
RetryQueryRunner
- .withDefaultSubQueryId()
- ),
- responseContext
- )
- )
+ IntStream.range(0, unionDataSource.getDataSources().size())
+ .mapToObj(i -> new Pair<>(i + 1,
unionDataSource.getDataSources().get(i)))
+ .map(indexBaseDataSourcePair ->
+ baseRunner.run(
+
queryPlus.withQuery(Queries.withBaseDataSource(
+ query,
+ indexBaseDataSourcePair.rhs
+ ).withSubQueryId(
+ generateSubqueryId(
+ query.getSubQueryId(),
+ // getName() works since the
datasource will be a TableDataSource
+
indexBaseDataSourcePair.rhs.getName(),
+ indexBaseDataSourcePair.lhs
+ )
+ ))
Review comment:
```suggestion
)),
responseContext
```
--
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]