Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.25.0
Description
Issue can be reproduced with the following test (to be added in EnumerableBatchNestedLoopJoinTest):
@Test void doubleInnerBatchJoinTestSQL() { tester(false, new JdbcTest.HrSchema()) .query("select e.name, d.name as dept, l.name as location " + "from emps e join depts d on d.deptno <> e.salary " + "join locations l on e.empid <> l.empid and d.deptno = l.empid") .withHook(Hook.PLANNER, (Consumer<RelOptPlanner>) planner -> { planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE); planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE); }) .explainContains("EnumerableBatchNestedLoopJoin") .returnsUnordered("name=Bill; dept=Sales; location=San Francisco", "name=Eric; dept=Sales; location=San Francisco", "name=Sebastian; dept=Sales; location=San Francisco", "name=Theodore; dept=Sales; location=San Francisco"); }
Which causes:
Error while executing SQL "explain plan for select e.name, d.name as dept, l.name as location from emps e join depts d on d.deptno <> e.salary join locations l on e.empid <> l.empid and d.deptno = l.empid" ... Caused by: java.lang.RuntimeException: Error while applying rule EnumerableBatchNestedLoopJoinRule, ... Caused by: java.lang.IllegalArgumentException: Field #0: empid JavaType(int) does not exist for expression $cor1801 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ... at org.apache.calcite.adapter.enumerable.EnumerableBatchNestedLoopJoinRule.onMatch(EnumerableBatchNestedLoopJoinRule.java:127) at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:229) ...
Attachments
Issue Links
- links to