libenchao commented on code in PR #3038:
URL: https://github.com/apache/calcite/pull/3038#discussion_r1087394193


##########
core/src/main/java/org/apache/calcite/rel/rules/ProjectAggregateMergeRule.java:
##########
@@ -99,25 +100,27 @@ && kindCount(project.getProjects(), SqlKind.CASE) == 0) {
               && operands.get(1).getKind() == SqlKind.CAST
               && ((RexCall) operands.get(1)).operands.get(0).getKind()
               == SqlKind.INPUT_REF
-              && operands.get(2).getKind() == SqlKind.LITERAL) {
+              && operands.get(2).getKind() == SqlKind.LITERAL
+              && operands.get(2).getType().getFamily() == 
SqlTypeFamily.NUMERIC) {

Review Comment:
   I was meant to remove this check originally since we can assume the operand 
is numeric when the aggregator is `SUM`. Sorry that this was still in my git 
staging.



-- 
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]

Reply via email to