You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2021/12/06 18:20:00 UTC

[jira] [Commented] (IGNITE-15984) Calcite engine. Query plan can't be planned if correlated variable used in both filter and project

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

Konstantin Orlov commented on IGNITE-15984:
-------------------------------------------

Looks like this ticket and IGNITE-16040 are about the same issue

> Calcite engine. Query plan can't be planned if correlated variable used in both filter and project
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-15984
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15984
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Priority: Major
>              Labels: calcite2-required, calcite3-required
>
> For example, query:
> {noformat}
> CREATE TABLE test(i INT)
> SELECT (SELECT t0.i FROM test t1 WHERE t1.i = t0.i) FROM test t0
> {noformat}
> Fails, but if we make project uncorrelated:
> {noformat}
> SELECT (SELECT t1.i FROM test t1 WHERE t1.i = t0.i) FROM test t0
> {noformat}
> Or remove correlated filter:
> {noformat}
> SELECT (SELECT t0.i FROM test t1) FROM test t0
> {noformat}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)