gortiz commented on code in PR #14071:
URL: https://github.com/apache/pinot/pull/14071#discussion_r1777012697
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/MaxAggregationFunction.java:
##########
@@ -190,12 +190,28 @@ public void aggregateGroupBySV(int length, int[]
groupKeyArray, GroupByResultHol
@Override
public void aggregateGroupByMV(int length, int[][] groupKeysArray,
GroupByResultHolder groupByResultHolder,
Map<ExpressionContext, BlockValSet> blockValSetMap) {
+ BlockValSet blockValSet = blockValSetMap.get(_expression);
double[] valueArray = blockValSetMap.get(_expression).getDoubleValuesSV();
- for (int i = 0; i < length; i++) {
- double value = valueArray[i];
- for (int groupKey : groupKeysArray[i]) {
- if (value > groupByResultHolder.getDoubleResult(groupKey)) {
- groupByResultHolder.setValueForKey(groupKey, value);
+
+ if (_nullHandlingEnabled) {
+ forEachNotNull(length, blockValSet, (from, to) -> {
Review Comment:
nit: given you already have the BlockValSet in `blockValSet` you can just
slightly simplify
```
double[] valueArray =
blockValSetMap.get(_expression).getDoubleValuesSV();
```
--
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]