xiangfu0 commented on code in PR #11556: URL: https://github.com/apache/pinot/pull/11556#discussion_r1321641330
########## pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgAggregationFunction.java: ########## @@ -37,11 +39,16 @@ public class AvgAggregationFunction extends BaseSingleInputAggregationFunction<A private static final double DEFAULT_FINAL_RESULT = Double.NEGATIVE_INFINITY; private final boolean _nullHandlingEnabled; - public AvgAggregationFunction(ExpressionContext expression) { - this(expression, false); + public AvgAggregationFunction(List<ExpressionContext> arguments, boolean nullHandlingEnabled) { + this(verifyArguments(arguments), nullHandlingEnabled); } - public AvgAggregationFunction(ExpressionContext expression, boolean nullHandlingEnabled) { + private static ExpressionContext verifyArguments(List<ExpressionContext> arguments) { Review Comment: Shall we move `verifyArguments` to a static method in `AggregationFunctionFactor`? Like `private static ExpressionContext verifySingleArgument(List<ExpressionContext> arguments, AggregationFunctionType funcType)` ########## pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgAggregationFunction.java: ########## @@ -37,11 +39,16 @@ public class AvgAggregationFunction extends BaseSingleInputAggregationFunction<A private static final double DEFAULT_FINAL_RESULT = Double.NEGATIVE_INFINITY; private final boolean _nullHandlingEnabled; - public AvgAggregationFunction(ExpressionContext expression) { - this(expression, false); + public AvgAggregationFunction(List<ExpressionContext> arguments, boolean nullHandlingEnabled) { + this(verifyArguments(arguments), nullHandlingEnabled); } - public AvgAggregationFunction(ExpressionContext expression, boolean nullHandlingEnabled) { + private static ExpressionContext verifyArguments(List<ExpressionContext> arguments) { Review Comment: Shall we make `verifyArguments` an abstract class? -- 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