kgyrtkirk commented on code in PR #14748:
URL: https://github.com/apache/druid/pull/14748#discussion_r1309664762
##########
processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:
##########
@@ -175,10 +175,13 @@ private Sequence<ResultRow> mergeGroupByResults(
ResponseContext context
)
{
+ Sequence<ResultRow> process;
if (isNestedQueryPushDown(query)) {
- return mergeResultsWithNestedQueryPushDown(query, resource, runner,
context);
+ process = mergeResultsWithNestedQueryPushDown(query, resource, runner,
context);
+ } else {
+ process = mergeGroupByResultsWithoutPushDown(query, resource, runner,
context);
}
- return mergeGroupByResultsWithoutPushDown(query, resource, runner,
context);
+ return GroupByQueryRunnerFactory.wrapSummaryRowIfNeeded(query, process);
Review Comment:
Thank you for taking a look!
unfortunately its needed - I've linked the test(s) checking this.
The leaf nodes are not necessarily aggregating (in case of `distinct`) so an
empty sequence may be produced - the merger supposed to aggregate them - that's
why this is needed.
For nested query stuff the merge runner becomes this
[lambda](https://github.com/apache/druid/blob/d201ea0ece00cf4408b0f358d93071472c606c4e/processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java#L125-L132)
(note: I don't know why I didn't placed this call there - just moved it)
example tests
*
[testCountDistinctNonApproximateEmptySet](https://github.com/apache/druid/pull/14748/files#diff-fe60470a1d97fa758f70099a5ed49168cfe57f726dc6f08578df9b575b9a21a1R1953)
is a sql level one
*
[testSummaryrowForEmptySubqueryInput](https://github.com/apache/druid/pull/14748/files#diff-df810dbf0150a412cc7b71f379267ecd7f1f1f4da906e961d7cbce718147d7b7R13004)
as a runnertest
--
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]