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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to