walterddr commented on code in PR #9676: URL: https://github.com/apache/pinot/pull/9676#discussion_r1008468222
########## 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: ah I didn't know Key is usable as a map hash key. good catch -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org