npaincomplet commented on code in PR #5422:
URL: https://github.com/apache/calcite/pull/5422#discussion_r4607308065


##########
core/src/test/resources/sql/agg.iq:
##########
@@ -4177,6 +4177,28 @@ EnumerableAggregate(group=[{}], agg#0=[$SUM0($0)])
     EnumerableTableScan(table=[[scott, EMP]])
 !plan
 
+# [CALCITE-7944] ProjectAggregateMergeRule uses incorrect column ordinals for 
SUM0

Review Comment:
   Yes, the test used to crash!
   The stack trace was:
   ```
   java.lang.AssertionError: type mismatch:
   ref:
   INTEGER NOT NULL
   input:
   INTEGER
   
       at org.apache.calcite.util.Litmus.lambda$static$0(Litmus.java:31)
       at 
org.apache.calcite.plan.RelOptUtil.eqUpToNullability(RelOptUtil.java:2279)
       at org.apache.calcite.rex.RexChecker.visitInputRef(RexChecker.java:131)
       at org.apache.calcite.rex.RexChecker.visitInputRef(RexChecker.java:62)
       at org.apache.calcite.rex.RexInputRef.accept(RexInputRef.java:125)
       at org.apache.calcite.rel.core.Project.isValid(Project.java:260)
       at org.apache.calcite.rel.core.Project.<init>(Project.java:106)
       ...
       at 
org.apache.calcite.rel.rules.ProjectAggregateMergeRule.onMatch(ProjectAggregateMergeRule.java:157)
       at 
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:223)
       at 
org.apache.calcite.plan.volcano.IterativeRuleDriver.drive(IterativeRuleDriver.java:61)
       at 
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:526)
   ```
   
   You can see ProjectAggregateMergeRule after the "...".



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