Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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
- is related to
-
CALCITE-4720 Obsolete the Collect relational operator, using Aggregate and ARRAY_AGG (and new aggregate functions MULTISET_AGG and MAP_AGG) instead
- Open
- relates to
-
CALCITE-4718 Erroneous correlate variables in case of using collect sub-queries into ARRAY, MAP and MULTISET.
- Open
-
CALCITE-4946 Add method RelBuilder.size()
- Closed
-
CALCITE-3524 Add methods to RelBuilder to create RexSubQuery
- Closed