mihaibudiu commented on code in PR #5003:
URL: https://github.com/apache/calcite/pull/5003#discussion_r3376428674
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlAvgAggFunction.java:
##########
@@ -86,4 +96,19 @@ public enum Subtype {
VAR_POP,
VAR_SAMP
}
+
+ @Override public @Nullable RexNode getConstantResult(RexBuilder rexBuilder,
+ RelDataType returnType) {
+ // Only statistical functions (variance and standard deviation) return 0
for constant values.
+ // AVG and other functions should not be optimized through this interface.
Review Comment:
Is this right when the aggregate argument is NULL?
--
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]