Dmitry Sysolyatin created CALCITE-7286:
------------------------------------------

             Summary: SqlToRelConverterTest.testJoinOnExists has wrong plan
                 Key: CALCITE-7286
                 URL: https://issues.apache.org/jira/browse/CALCITE-7286
             Project: Calcite
          Issue Type: Improvement
            Reporter: Dmitry Sysolyatin


It looks like the plan for this test is missing variables set. The variable 
`$cor0` is used, but there’s no information about where it was defined.

{code}
 <TestCase name="testJoinOnExists">
    <Resource name="sql">
      <![CDATA[select * from emp left join dept
on emp.empno = 1
or exists (select deptno from emp where empno > dept.deptno + 5)]]>
    </Resource>
    <Resource name="plan">
      <![CDATA[
LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8], DEPTNO0=[$9], NAME=[$10])
  LogicalJoin(condition=[OR(=($0, 1), EXISTS({
LogicalFilter(condition=[>($0, +($cor0.DEPTNO0, 5))])
  LogicalTableScan(table=[[CATALOG, SALES, EMP]])
}))], joinType=[left])
    LogicalTableScan(table=[[CATALOG, SALES, EMP]])
    LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
]]>
    </Resource>
  </TestCase>
{code}





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to