You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ka...@apache.org on 2024/01/17 15:13:51 UTC

(druid) branch master updated: Fix summary iterator in grouping engine(#15658)

This is an automated email from the ASF dual-hosted git repository.

karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new fc06f2d075f Fix summary iterator in grouping engine(#15658)
fc06f2d075f is described below

commit fc06f2d075fd5f96a20ff4eeaecdef56f717b2b0
Author: Laksh Singla <la...@gmail.com>
AuthorDate: Wed Jan 17 20:43:45 2024 +0530

    Fix summary iterator in grouping engine(#15658)
    
    This PR fixes the summary iterator to add aggregators in the correct position. The summary iterator is used when dims are not present, therefore the new change is identical to the old one, but seems more correct while reading.
---
 .../src/main/java/org/apache/druid/query/groupby/GroupingEngine.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java b/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java
index 3938516ba36..0c419055c5f 100644
--- a/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java
+++ b/processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java
@@ -950,7 +950,10 @@ public class GroupingEngine
     List<AggregatorFactory> aggSpec = q.getAggregatorSpecs();
     ResultRow resultRow = ResultRow.create(q.getResultRowSizeWithPostAggregators());
     for (int i = 0; i < aggSpec.size(); i++) {
-      resultRow.set(i, aggSpec.get(i).factorize(new AllNullColumnSelectorFactory()).get());
+      resultRow.set(
+          q.getResultRowAggregatorStart() + i,
+          aggSpec.get(i).factorize(new AllNullColumnSelectorFactory()).get()
+      );
     }
     Map<String, Object> map = resultRow.toMap(q);
     for (int i = 0; i < q.getPostAggregatorSpecs().size(); i++) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org