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

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

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

query II
SELECT i, (SELECT 42+i1.i FROM integers) AS j FROM integers i1 ORDER BY i;
----
NULL    NULL
1       43
2       44
3       45
{noformat}


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

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

# aggregate with correlation in final projection
query II
SELECT i, (SELECT MIN(i)+i1.i FROM integers) FROM integers i1 ORDER BY i;
----
NULL    NULL
1       2
2       3
3       4
{noformat}



{noformat}
 Error occurred during execution: java.lang.NullPointerException
        at 
o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:36)
        at 
o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:27)
        at SC.execute(Unknown Source)
        at 
o.a.i.i.processors.query.calcite.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:473)
        at 
o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.advance(TableScan.java:273)
        at 
o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.hasNextX(TableScan.java:221)
{noformat}


{noformat}
/subquery/scalar/test_correlated_subquery.test[_ignore]
/subquery/scalar/test_correlated_aggregate_subquery.test[_ignore]
/subquery/scalar/test_many_correlated_columns.test[_ignore]
{noformat}


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

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

query II
SELECT i, (SELECT 42+i1.i FROM integers) AS j FROM integers i1 ORDER BY i;
----
NULL    NULL
1       43
2       44
3       45
{noformat}


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

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

# aggregate with correlation in final projection
query II
SELECT i, (SELECT MIN(i)+i1.i FROM integers) FROM integers i1 ORDER BY i;
----
NULL    NULL
1       2
2       3
3       4
{noformat}



{noformat}
 Error occurred during execution: java.lang.NullPointerException
        at 
o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:36)
        at 
o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:27)
        at SC.execute(Unknown Source)
        at 
o.a.i.i.processors.query.calcite.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:473)
        at 
o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.advance(TableScan.java:273)
        at 
o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.hasNextX(TableScan.java:221)
{noformat}


{noformat}
/subquery/scalar/test_correlated_subquery.test[_ignore]
/subquery/scalar/test_correlated_aggregate_subquery.test[_ignore]
{noformat}



> Calcite. NPE on subquery returning multiple results.
> ----------------------------------------------------
>
>                 Key: IGNITE-15603
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15603
>             Project: Ignite
>          Issue Type: Bug
>          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 II
> SELECT i, (SELECT 42+i1.i FROM integers) AS j FROM integers i1 ORDER BY i;
> ----
> NULL  NULL
> 1     43
> 2     44
> 3     45
> {noformat}
> {noformat}
> statement ok
> CREATE TABLE integers(i INTEGER)
> statement ok
> INSERT INTO integers VALUES (1), (2), (3), (NULL)
> # aggregate with correlation in final projection
> query II
> SELECT i, (SELECT MIN(i)+i1.i FROM integers) FROM integers i1 ORDER BY i;
> ----
> NULL  NULL
> 1     2
> 2     3
> 3     4
> {noformat}
> {noformat}
>  Error occurred during execution: java.lang.NullPointerException
>       at 
> o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:36)
>       at 
> o.a.i.i.processors.query.calcite.exec.ArrayRowHandler.get(ArrayRowHandler.java:27)
>       at SC.execute(Unknown Source)
>       at 
> o.a.i.i.processors.query.calcite.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:473)
>       at 
> o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.advance(TableScan.java:273)
>       at 
> o.a.i.i.processors.query.calcite.exec.TableScan$IteratorImpl.hasNextX(TableScan.java:221)
> {noformat}
> {noformat}
> /subquery/scalar/test_correlated_subquery.test[_ignore]
> /subquery/scalar/test_correlated_aggregate_subquery.test[_ignore]
> /subquery/scalar/test_many_correlated_columns.test[_ignore]
> {noformat}



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

Reply via email to