Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13721

Calcite bug. IndexOutOfBoundsException while executing NOT IN with nested expression.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: sql
    • Labels:

      Description

      SELECT name FROM Orders WHERE name NOT IN (SELECT name from Account)
      breaks current execution with :

      	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)
      

      plan looks like weird:

      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
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex_pl Aleksey Plekhanov
                Reporter:
                zstan Stanilovsky Evgeny
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m