You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2021/09/24 08:45:00 UTC

[jira] [Updated] (IGNITE-15585) Calcite. Unexpected result with EXIST and subquery.

     [ https://issues.apache.org/jira/browse/IGNITE-15585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Stanilovsky updated IGNITE-15585:
----------------------------------------
    Description: 
{noformat}
statement ok
CREATE TABLE integers(i INTEGER)

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

query IT
SELECT i, EXISTS(SELECT i FROM integers WHERE i=i1.i) FROM integers i1 ORDER BY i NULLS FIRST;
----
NULL	false
1	true
2	true
3	true
{noformat}


{noformat}
/subquery/exists/test_correlated_exists.test[_ignore]
{noformat}


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

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

# SUM on exists
query R
SELECT SUM(CASE WHEN EXISTS(SELECT i FROM integers WHERE i=i1.i) THEN 1 ELSE 0 END) FROM integers i1;
----
3.000000
{noformat}


checked with mysql, all ok there.


  was:

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

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

query IT
SELECT i, EXISTS(SELECT i FROM integers WHERE i=i1.i) FROM integers i1 ORDER BY i NULLS FIRST;
----
NULL	false
1	true
2	true
3	true
{noformat}


{noformat}
/subquery/exists/test_correlated_exists.test[_ignore]
{noformat}

checked with mysql, all ok there.



> Calcite. Unexpected result with EXIST and subquery.
> ---------------------------------------------------
>
>                 Key: IGNITE-15585
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15585
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Evgeny Stanilovsky
>            Priority: Major
>              Labels: calcite, calcite2-required, calcite3-required, ignite-3
>
> {noformat}
> statement ok
> CREATE TABLE integers(i INTEGER)
> statement ok
> INSERT INTO integers VALUES (1), (2), (3), (NULL)
> query IT
> SELECT i, EXISTS(SELECT i FROM integers WHERE i=i1.i) FROM integers i1 ORDER BY i NULLS FIRST;
> ----
> NULL	false
> 1	true
> 2	true
> 3	true
> {noformat}
> {noformat}
> /subquery/exists/test_correlated_exists.test[_ignore]
> {noformat}
> {noformat}
> statement ok
> CREATE TABLE integers(i INTEGER)
> statement ok
> INSERT INTO integers VALUES (1), (2), (3), (NULL)
> # SUM on exists
> query R
> SELECT SUM(CASE WHEN EXISTS(SELECT i FROM integers WHERE i=i1.i) THEN 1 ELSE 0 END) FROM integers i1;
> ----
> 3.000000
> {noformat}
> checked with mysql, all ok there.



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