You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/11/03 05:40:34 UTC

[GitHub] [pinot] 61yao commented on a diff in pull request #9676: [multistage] [bugfix] fix agg hash collision bug

61yao commented on code in PR #9676:
URL: https://github.com/apache/pinot/pull/9676#discussion_r1012517384


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/AggregateOperator.java:
##########
@@ -128,16 +123,12 @@ private TransferableBlock produceAggregatedBlock()
       return _upstreamErrorBlock;
     }
     if (!_isCumulativeBlockConstructed) {
-      List<Object[]> rows = new ArrayList<>(_groupByKeyHolder.size());
-      for (Map.Entry<Integer, Object[]> e : _groupByKeyHolder.entrySet()) {
-        Object[] row = new Object[_aggregationFunctions.length + _groupSet.size()];
-        Object[] keyElements = e.getValue();
-        for (int i = 0; i < keyElements.length; i++) {
-          row[i] = keyElements[i];
-        }
-        for (int i = 0; i < _groupByResultHolders.length; i++) {
-          row[i + _groupSet.size()] = _groupByResultHolders[i].get(e.getKey());
-        }
+      List<Object[]> rows = new ArrayList<>(_groupByResultHolders.size());
+      // Each row is written in the format of [group by keys, aggregate result1, ...aggregate resultN]
+      for (Map.Entry<Key, Object[]> e : _groupByResultHolders.entrySet()) {

Review Comment:
   added a test and PTAL



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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