Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4719

Add variants of RexSubQuery that collect sub-queries into MULTISET, ARRAY and MAP collections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.28.0
    • None
    • None

    Description

      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:

      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
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: