DongShengHe created CALCITE-7825:
------------------------------------

             Summary: RelMdTableReferences does not account for tables in 
RexSubQuery expressions or Correlate
                 Key: CALCITE-7825
                 URL: https://issues.apache.org/jira/browse/CALCITE-7825
             Project: Calcite
          Issue Type: Bug
            Reporter: DongShengHe


This issue follows up on the review discussion in [PR 
5288|https://github.com/apache/calcite/pull/5288]

RelMdTableReferences does not inspect RexSubQuery expressions in Project,
Filter, Join, or Calc. With expand=false, for example:
{code:java}
SELECT (SELECT MAX(sal) FROM emp) FROM dept
SELECT * FROM dept WHERE deptno IN (SELECT deptno FROM emp)
{code}
Both report only DEPT, omitting EMP.

RelMdTableReferences also has no Correlate handler. When a sub-query is
rewritten into a Correlate, getTableReferences returns null.



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

Reply via email to