Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Repro:
@Test public void testGtAnyInProject() { final String sql = "select name, \n" + " deptno > ANY (\n" + " select deptno from emp) \n" + " from dept"; checkSubQuery(sql).withLateDecorrelation(true).check(); }
Exception:
java.lang.AssertionError: Cannot add expression of different type to set: set type is RecordType(VARCHAR(10) NOT NULL NAME, BOOLEAN NOT NULL EXPR$1) NOT NULL expression type is RecordType(VARCHAR(10) NOT NULL NAME, BOOLEAN EXPR$1) NOT NULL set is rel#5:LogicalProject(input=HepRelVertex#4,NAME=$1,EXPR$1=> SOME($0, { LogicalProject(DEPTNO=[$7]) LogicalTableScan(table=[[CATALOG, SALES, EMP]]) })) expression is LogicalProject(NAME=[$1], EXPR$1=[OR(AND(IS TRUE(>($0, $2)), <>($3, 0)), AND(>($3, $4), null, <>($3, 0), IS NOT TRUE(>($0, $2))), AND(>($0, $2), <>($3, 0), IS NOT TRUE(>($0, $2)), <=($3, $4)))]) LogicalJoin(condition=[true], joinType=[inner]) LogicalTableScan(table=[[CATALOG, SALES, DEPT]]) LogicalAggregate(group=[{}], m=[MIN($0)], c=[COUNT()], d=[COUNT($0)]) LogicalProject(DEPTNO=[$7]) LogicalTableScan(table=[[CATALOG, SALES, EMP]]) at org.apache.calcite.plan.RelOptUtil.verifyTypeEquivalence(RelOptUtil.java:382) at org.apache.calcite.plan.hep.HepRuleCall.transformTo(HepRuleCall.java:57) at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:236) at org.apache.calcite.rel.rules.SubQueryRemoveRule$SubQueryProjectRemoveRule.onMatch(SubQueryRemoveRule.java:519)
Attachments
Issue Links
- links to