Description
For example, query:
CREATE TABLE test(i INT) SELECT (SELECT t0.i FROM test t1 WHERE t1.i = t0.i) FROM test t0
Fails, but if we make project uncorrelated:
SELECT (SELECT t1.i FROM test t1 WHERE t1.i = t0.i) FROM test t0
Or remove correlated filter:
SELECT (SELECT t0.i FROM test t1) FROM test t0
Query executes successfully.
Reson: for filter and for project new correlates are created each time, but SubQueryRemoveRule expects only one correlate to build LogicalCorrelate relational operator. If the count of correlates is not equal to one - a regular join is created and the query can't be planned.
Attachments
Issue Links
- is duplicated by
-
IGNITE-15595 Calcite. Correlated expressions with subquery can be planned.
- Resolved
-
IGNITE-16040 Calcite. Unable to plan query with several correlated sub-queries in select list
- Resolved
- is part of
-
IGNITE-12248 Apache Calcite based query execution engine
- Open