xiangfu0 commented on code in PR #10846: URL: https://github.com/apache/pinot/pull/10846#discussion_r1242671755
########## pinot-core/src/main/java/org/apache/pinot/core/query/reduce/function/InternalReduceFunctions.java: ########## @@ -35,17 +35,61 @@ private InternalReduceFunctions() { } @ScalarFunction - public static double skewnessReduce(PinotFourthMoment fourthMoment) { + public static Double skewnessReduce(PinotFourthMoment fourthMoment) { + if (fourthMoment == null) { + return null; + } return fourthMoment.skew(); } @ScalarFunction - public static double kurtosisReduce(PinotFourthMoment fourthMoment) { + public static Double kurtosisReduce(PinotFourthMoment fourthMoment) { + if (fourthMoment == null) { + return null; + } return fourthMoment.kurtosis(); } @ScalarFunction - public static int countDistinctReduce(Set<?> values) { + public static Integer countDistinctReduce(Set<?> values) { return values.size(); } + + @ScalarFunction + public static Double maxReduce(Double intermediateResult) { + return intermediateResult; Review Comment: You can just have a `SingleValueReduce` to avoid the code duplication? ########## pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AggregationFunctionFactory.java: ########## @@ -189,8 +188,7 @@ public static AggregationFunction getAggregationFunction(FunctionContext functio case MAX: return new MaxAggregationFunction(firstArgument, nullHandlingEnabled); case SUM: - // TODO(Sonam): Uncomment SUM0 when merging planner changes - // case SUM0: + case SUM0: Review Comment: Is there any other functions need to append 0 after the function name? -- 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