You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/08/05 18:59:00 UTC

[jira] [Created] (CALCITE-4719) Add variants of RexSubQuery that collect sub-queries into MULTISET, ARRAY and MAP collections

Julian Hyde created CALCITE-4719:
------------------------------------

             Summary: Add variants of RexSubQuery that collect sub-queries into MULTISET, ARRAY and MAP collections
                 Key: CALCITE-4719
                 URL: https://issues.apache.org/jira/browse/CALCITE-4719
             Project: Calcite
          Issue Type: Bug
         Environment: Add variants of {{RexSubQuery}} that collect sub-queries into {{MULTISET}}, {{ARRAY}} and {{MAP}} collections. We currently use {{RexSubQuery}} for scalar sub-query, {{EXISTS}}, {{IN}} and some others; this allows us to defer conversion: convert via rewrites ({{RelOptRule}}) rather than in {{SqlToRelConverter}}. The same benefits would apply to {{MULTISET}}, {{ARRAY}} and {{MAP}} sub-queries.

Examples:
{code}
SELECT deptno, MULTISET(SELECT * FROM Emp WHERE deptno = d.deptno)
FROM Dept AS d

SELECT deptno, ARRAY(SELECT * FROM Emp WHERE deptno = d.deptno)
FROM Dept AS d

SELECT deptno, MAP(SELECT empno, job FROM Emp WHERE deptno = d.deptno)
FROM Dept AS d
{code}

            Reporter: Julian Hyde






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