birschick-bq commented on code in PR #3038: URL: https://github.com/apache/calcite/pull/3038#discussion_r1082986380
########## 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: Optionally, you could move this test (`operands.get(2).getType().getFamily() == SqlTypeFamily.NUMERIC`) to just before the call to `literal.getValueAs(BigDecimal.class)` - it might have better context. -- 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...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org