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

[jira] [Assigned] (IGNITE-13721) Calcite bug. IndexOutOfBoundsException while executing NOT IN with nested expression.

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

Aleksey Plekhanov reassigned IGNITE-13721:
------------------------------------------

    Assignee: Aleksey Plekhanov

> Calcite bug. IndexOutOfBoundsException while executing NOT IN with nested expression. 
> --------------------------------------------------------------------------------------
>
>                 Key: IGNITE-13721
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13721
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Stanilovsky Evgeny
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>              Labels: calcite
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> _SELECT name FROM Orders WHERE name NOT IN (SELECT name from Account)_
> breaks current execution with :
> {code:java}
> 	Caused by: java.lang.NullPointerException
> 		at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:115)
> 		at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.doPush(ScanNode.java:75)
> 		... 3 more
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0
> 	at java.util.Collections$EmptyList.get(Collections.java:4454)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$WrapperPrototype$1.apply(AccumulatorsFactory.java:220)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$WrapperPrototype$1.apply(AccumulatorsFactory.java:217)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$AccumulatorWrapperImpl.add(AccumulatorsFactory.java:296)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.AggregateNode$Grouping.addOnMapper(AggregateNode.java:306)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.AggregateNode$Grouping.add(AggregateNode.java:277)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.AggregateNode$Grouping.access$100(AggregateNode.java:251)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.AggregateNode.push(AggregateNode.java:132)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:119)
> 	at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.doPush(ScanNode.java:75)
> {code}
> plan looks like weird:
> {code:java}
> IgniteProject(NAME=[$2]): rowcount = 25003.75, cumulative cost = 2851029.25, id = 1305
>   IgniteFilter(condition=[OR(=($4, 0), AND(IS NULL($8), >=($5, $4), IS NOT NULL($6)))]): rowcount = 25003.75, cumulative cost = 2826024.5, id = 1304
>     IgniteNestedLoopJoin(condition=[=($6, $7)], joinType=[left], variablesSet=[[]]): rowcount = 100015.0, cumulative cost = 2726008.5, id = 1303
>       IgniteProject(_KEY=[$0], _VAL=[$1], NAME=[$2], SALARY=[$3], $f0=[$4], $f1=[$5], NAME0=[$2]): rowcount = 100000.0, cumulative cost = 1721436.0, id = 1299
>         IgniteNestedLoopJoin(condition=[true], joinType=[inner], variablesSet=[[]]): rowcount = 100000.0, cumulative cost = 1021435.0, id = 1298
>           IgniteExchange(distribution=[broadcast]): rowcount = 1000.0, cumulative cost = 17000.0, id = 1294
>             IgniteTableScan(table=[[PUBLIC, ORDERS]]): rowcount = 1000.0, cumulative cost = 1000.0, id = 206
>           IgniteReduceAggregate(rowType=[RecordType(BIGINT $f0, BIGINT $f1)], group=[{}], agg#0=[COUNT()], agg#1=[COUNT($0)]): rowcount = 100.0, cumulative cost = 4425.0, id = 1297
>             IgniteExchange(distribution=[broadcast]): rowcount = 100.0, cumulative cost = 4325.0, id = 1296
>               IgniteMapAggregate(group=[{}], agg#0=[COUNT()], agg#1=[COUNT($0)]): rowcount = 100.0, cumulative cost = 3125.0, id = 1295
>                 IgniteTableScan(table=[[PUBLIC, ACCOUNT]], projects=[[$t0, true]], requiredColunms=[{2}]): rowcount = 1000.0, cumulative cost = 3000.0, id = 140
>       IgniteReduceAggregate(rowType=[RecordType(JavaType(class java.lang.String) NAME, BOOLEAN $f1)], group=[{0}], agg#0=[MIN($1)]): rowcount = 100.0, cumulative cost = 4412.5, id = 1302
>         IgniteExchange(distribution=[single]): rowcount = 100.0, cumulative cost = 4312.5, id = 1301
>           IgniteMapAggregate(group=[{0}], agg#0=[MIN($1)]): rowcount = 100.0, cumulative cost = 3112.5, id = 1300
>             IgniteTableScan(table=[[PUBLIC, ACCOUNT]], projects=[[$t0, true]], requiredColunms=[{2}]): rowcount = 1000.0, cumulative cost = 3000.0, id = 140
> {code}



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