You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "libenchao (via GitHub)" <gi...@apache.org> on 2023/01/26 02:57:46 UTC
[GitHub] [calcite] libenchao commented on a diff in pull request #3038: [CALCITE-5483] ProjectAggregateMergeRule throws exception if literal is non-numeric
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org