xiangfu0 commented on code in PR #13611:
URL: https://github.com/apache/pinot/pull/13611#discussion_r1678430382
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/utils/AggregationUtils.java:
##########
@@ -170,25 +169,18 @@ default Object init(@Nullable Object value,
ColumnDataType dataType) {
*/
public static class Accumulator {
//@formatter:off
- public static final Map<String, Function<DataSchema.ColumnDataType,
AggregationUtils.Merger>> MERGERS =
- ImmutableMap.<String, Function<DataSchema.ColumnDataType,
AggregationUtils.Merger>>builder()
- .put("SUM", cdt -> AggregationUtils::mergeSum)
- .put("$SUM", cdt -> AggregationUtils::mergeSum)
- .put("$SUM0", cdt -> AggregationUtils::mergeSum)
- .put("MIN", cdt -> AggregationUtils::mergeMin)
- .put("$MIN", cdt -> AggregationUtils::mergeMin)
- .put("$MIN0", cdt -> AggregationUtils::mergeMin)
- .put("MAX", cdt -> AggregationUtils::mergeMax)
- .put("$MAX", cdt -> AggregationUtils::mergeMax)
- .put("$MAX0", cdt -> AggregationUtils::mergeMax)
- .put("COUNT", cdt -> new AggregationUtils.MergeCounts())
- .put("BOOL_AND", cdt -> AggregationUtils::mergeBoolAnd)
- .put("$BOOL_AND", cdt -> AggregationUtils::mergeBoolAnd)
- .put("$BOOL_AND0", cdt -> AggregationUtils::mergeBoolAnd)
- .put("BOOL_OR", cdt -> AggregationUtils::mergeBoolOr)
- .put("$BOOL_OR", cdt -> AggregationUtils::mergeBoolOr)
- .put("$BOOL_OR0", cdt -> AggregationUtils::mergeBoolOr)
- .build();
+ public static final Map<String, Function<DataSchema.ColumnDataType,
AggregationUtils.Merger>> MERGERS = Map.of(
+ "SUM", cdt -> AggregationUtils::mergeSum,
+ // NOTE: Keep both 'SUM0' and '$SUM0' for backward compatibility where
'SUM0' is SqlKind and '$SUM0' is function
+ // name.
+ "SUM0", cdt -> AggregationUtils::mergeSum,
+ "$SUM0", cdt -> AggregationUtils::mergeSum,
+ "MIN", cdt -> AggregationUtils::mergeMin,
Review Comment:
Will there be `MIN0`, `MAX0` or `BOOL_OR0`?
--
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]