[ 
https://issues.apache.org/jira/browse/IGNITE-27555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18052341#comment-18052341
 ] 

Iurii Gerzhedovich commented on IGNITE-27555:
---------------------------------------------

Let's try to use the new decorelator which will be presented in Calcite 1.42, 
potentially the issue will be get rid.

> Sql. Wrong plan generated by decorrelator when correlation id is used in 
> multiple operators
> -------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-27555
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27555
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql ai3
>            Reporter: Konstantin Orlov
>            Priority: Major
>              Labels: ignite-3
>
> This problem was discovered while implementing IGNITE-22092. To reproduce it 
> may be needed to remove validation in 
> {{org.apache.ignite.internal.sql.engine.prepare.PlannerHelper#tryDecorrelate}}
>  (search for usages of {{CorrelationUsedOnlyInSingleRelValidator}}).
> Take a look at this test cases:
> {code:java}
> CREATE TABLE integers(i INTEGER)
> INSERT INTO integers VALUES (1), (2), (3), (NULL)
> SELECT i, (SELECT COUNT(*) FROM integers i2 WHERE i2.i>i1.i GROUP BY i1.i) 
> FROM integers i1 ORDER BY i;
> ----
> 1     2
> 2     1
> 3     NULL
> NULL  NULL
> {code}
> If we disable aforementioned validation, then test will fail with {{Invalid 
> results: [[1, 3], [2, 3], [3, 3], [null, 3]]}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to