Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.29.0
-
None
-
None
Description
Found by JdbcTest.
Test query:
CalciteAssert.hr() .query("select (select (select t.\"empid\")) from \"hr\".\"emps\" t") .returnsCount(4);
Error:
java.lang.AssertionError: type mismatch:
ref:
JavaType(int) NOT NULL
input:
INTEGER NOT NULL
Stacktrace:
at org.apache.calcite.util.Litmus$1.fail(Litmus.java:32) at org.apache.calcite.plan.RelOptUtil.eq(RelOptUtil.java:2211) at org.apache.calcite.rex.RexChecker.visitInputRef(RexChecker.java:129) at org.apache.calcite.rex.RexChecker.visitInputRef(RexChecker.java:61) at org.apache.calcite.rex.RexInputRef.accept(RexInputRef.java:114) at org.apache.calcite.rex.RexChecker.visitCall(RexChecker.java:144) at org.apache.calcite.rex.RexChecker.visitCall(RexChecker.java:61) at org.apache.calcite.rex.RexCall.accept(RexCall.java:189) at org.apache.calcite.rel.core.Project.isValid(Project.java:219) at org.apache.calcite.rel.core.Project.<init>(Project.java:98) at org.apache.calcite.rel.logical.LogicalProject.<init>(LogicalProject.java:69) at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:126) at org.apache.calcite.rel.logical.LogicalProject.create(LogicalProject.java:114) at org.apache.calcite.rel.core.RelFactories$ProjectFactoryImpl.createProject(RelFactories.java:178) at org.apache.calcite.tools.RelBuilder.project_(RelBuilder.java:2020) at org.apache.calcite.tools.RelBuilder.project(RelBuilder.java:1792) at org.apache.calcite.tools.RelBuilder.projectNamed(RelBuilder.java:2083) at org.apache.calcite.sql2rel.RelDecorrelator.projectJoinOutputWithNullability(RelDecorrelator.java:1445) at org.apache.calcite.sql2rel.RelDecorrelator.access$900(RelDecorrelator.java:147) at org.apache.calcite.sql2rel.RelDecorrelator$RemoveCorrelationForScalarProjectRule.onMatch(RelDecorrelator.java:2149) at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:343) at org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:565) at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:428) at org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:251) at org.apache.calcite.plan.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:130) at org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:208) at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:195) at org.apache.calcite.sql2rel.RelDecorrelator.removeCorrelationViaRule(RelDecorrelator.java:378) at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateQuery(RelDecorrelator.java:221) at org.apache.calcite.tools.Programs$DecorrelateProgram.run(Programs.java:361) at org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:336) at org.apache.calcite.prepare.Prepare.optimize(Prepare.java:177) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:312) at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647) at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513) at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
Attachments
Issue Links
- is related to
-
IGNITE-16000 Calcite engine. Assertion error on SubQueryRemoveRule for correlated queries
- Open