You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Q L (Jira)" <ji...@apache.org> on 2020/09/21 07:32:00 UTC

[jira] [Resolved] (CALCITE-4261) Join with three tables causes IllegalArgumentException in EnumerableBatchNestedLoopJoinRule

     [ https://issues.apache.org/jira/browse/CALCITE-4261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Q L resolved CALCITE-4261.
--------------------------------
    Resolution: Fixed

Fixed via https://github.com/apache/calcite/commit/43cf101576e3108f94aa51ffe4257a1d2a37823e

> Join with three tables causes IllegalArgumentException in EnumerableBatchNestedLoopJoinRule
> -------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4261
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4261
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.25.0
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.26.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Issue can be reproduced with the following test (to be added in {{EnumerableBatchNestedLoopJoinTest}}):
> {code}
>   @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");
>   }
> {code}
> Which causes:
> {code}
> 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)
> ...
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)