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: [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]