Evgeny Stanilovsky created IGNITE-15595:
-------------------------------------------

             Summary: Calcite. Correlated expressions with subquery can be 
planned.
                 Key: IGNITE-15595
                 URL: https://issues.apache.org/jira/browse/IGNITE-15595
             Project: Ignite
          Issue Type: Bug
          Components: sql
            Reporter: Evgeny Stanilovsky



{noformat}
statement ok
CREATE TABLE integers(i INTEGER)

statement ok
INSERT INTO integers VALUES (1), (2), (3), (NULL)

# union with correlated expression
query II
SELECT i, (SELECT i FROM integers WHERE i=i1.i UNION SELECT i FROM integers 
WHERE i=i1.i) AS j FROM integers i1 ORDER BY i NULLS FIRST;
----
NULL    NULL
1       1
2       2
3       3

# join on two subqueries that both have a correlated expression in them
query II
SELECT i, (SELECT s1.i FROM (SELECT i FROM integers WHERE i=i1.i) s1 INNER JOIN 
(SELECT i FROM integers WHERE i=4-i1.i) s2 ON s1.i>s2.i) AS j FROM integers i1 
ORDER BY i;
----
NULL    NULL
1       NULL
2       NULL
3       3
{noformat}


{noformat}
/subquery/scalar/test_complex_correlated_subquery.test[_ignore]
{noformat}


{noformat}
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImplc{1}]
 Unexpected error at query optimizer.
org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough 
rules to produce a node with desired properties: convention=IGNITE, sort=[0 
ASC-nulls-first], distr=single, rewindability=one-way, correlation=uncorrelated.
Missing conversions are LogicalFilter[convention: NONE -> IGNITE, distr: any -> 
random], IgniteUnionAll[sort: [] -> [0]], LogicalFilter[convention: NONE -> 
IGNITE, sort: [] -> [0], distr: any -> random, rewindability: one-way -> 
rewindable], LogicalFilter[convention: NONE -> IGNITE, distr: any -> single], 
LogicalFilter[convention: NONE -> IGNITE, distr: any -> single, rewindability: 
one-way -> rewindable]
There are 5 empty subsets:
{noformat}




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

Reply via email to