xiangfu0 commented on code in PR #18822:
URL: https://github.com/apache/pinot/pull/18822#discussion_r3452059633
##########
pinot-core/src/main/java/org/apache/pinot/core/common/MinionConstants.java:
##########
@@ -173,7 +173,7 @@ public static class MergeRollupTask extends MergeTask {
/// with RealtimeToOfflineSegmentsTask, which performs the same rollup
aggregation when configured with rollup
/// merge type.
public static final EnumSet<AggregationFunctionType>
AVAILABLE_CORE_VALUE_AGGREGATORS =
- EnumSet.of(MIN, MAX, SUM, DISTINCTCOUNTHLL, DISTINCTCOUNTRAWHLL,
DISTINCTCOUNTTHETASKETCH,
+ EnumSet.of(MIN, MAX, SUM, AVG, DISTINCTCOUNTHLL, DISTINCTCOUNTRAWHLL,
DISTINCTCOUNTTHETASKETCH,
Review Comment:
Adding `AVG` here makes the task generators accept configs that the reducer
still cannot execute on ordinary numeric metric columns. `RollupReducer` only
keys off the aggregation type, so it will now instantiate `AvgValueAggregator`,
which blindly casts the stored values to `byte[]`. For a normal
`INT`/`LONG`/`DOUBLE` metric this gets past validation and then fails at
runtime with `ClassCastException` instead of being rejected up front. Can we
gate this on `BYTES`/serialized `AvgPair` columns (or add equivalent schema
validation) before enabling `AVG` in the allowed set?
--
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]