Sergey Nuyanzin created CALCITE-7698:
----------------------------------------

             Summary: RelDecorrelator throws AssertionError when decorrelating 
a correlated sub-query with outer join
                 Key: CALCITE-7698
                 URL: https://issues.apache.org/jira/browse/CALCITE-7698
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Sergey Nuyanzin
            Assignee: Sergey Nuyanzin


sql to reproduce the issue
{code:sql}

  SELECT * FROM emp WHERE EXISTS (
    SELECT * FROM (SELECT * FROM dept
      WHERE dept.deptno = emp.deptno AND dept.deptno > 100) s
    LEFT JOIN bonus ON s.name = bonus.ename AND emp.ename = bonus.job)
{code}
it throws
{noformat}
java.lang.AssertionError
        at 
org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:1929)
        at 
org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:1895)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:533)
        at 
org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:1046)
{noformat}



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

Reply via email to