Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.3.0-incubating
-
None
-
None
Description
This may be a regression caused by CALCITE-694. Following query hits an AssertionError:
SELECT emp.deptno FROM emp group by emp.deptno having max(emp.empno) > (select min(emp.empno) from emp);
Stack trace:
java.lang.AssertionError: null
at org.apache.calcite.sql2rel.RelStructuredTypeFlattener.getNewForOldInput(RelStructuredTypeFlattener.java:291)
at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitInputRef(RelStructuredTypeFlattener.java:725)
at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitInputRef(RelStructuredTypeFlattener.java:722)
at org.apache.calcite.rex.RexInputRef.accept(RexInputRef.java:112)
at org.apache.calcite.rex.RexShuttle.visitList(RexShuttle.java:134)
at org.apache.calcite.rex.RexShuttle.visitCall(RexShuttle.java:83)
at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitCall(RelStructuredTypeFlattener.java:795)
at org.apache.calcite.sql2rel.RelStructuredTypeFlattener$RewriteRexShuttle.visitCall(RelStructuredTypeFlattener.java:722)