Julian Hyde created CALCITE-4366:
------------------------------------

             Summary: LatticeSuggester should treat UNION / VALUES 
sub-expressions as tables
                 Key: CALCITE-4366
                 URL: https://issues.apache.org/jira/browse/CALCITE-4366
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


LatticeSuggester should treat UNION / VALUES sub-expressions as tables, and 
generate a LatticeTable for each.

If those expressions occur as a common-table expression (CTE; i.e. in the WITH 
clause) the LatticeTable should have the name and column names of that CTE.

For example, given the query
{code}
WITH SubDept (id, name) AS (SELECT deptno, dname FROM Dept)
SELECT *
FROM Emp AS e
JOIN SubDept AS d ON e.deptno = d.id
{code}
{{LatticeSuggester}} should generate {{LatticeTable(Emp (empno, deptno, ename, 
sal))}} and {{LatticeTable(SubDept (id, name))}}.



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

Reply via email to