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

Calcite. Assertion in COUNT(DISTINCT) accumulator.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14
    • 2.17
    • None
    • SQL Calcite: Fixed failure in COUNT(DISTINCT) operation.
    • Release Notes Required

    Description

      Reproducer:

      CREATE TABLE integers(i INTEGER)
      INSERT INTO integers VALUES (1), (2), (3), (NULL)
      SELECT i=ALL(SELECT i FROM integers WHERE i<>i1.i) FROM integers i1 ORDER BY i;
      

      Result:

      Caused by: java.lang.AssertionError: idx=0; arglist=[]
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.Accumulators$AbstractAccumulator.get(Accumulators.java:272)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.Accumulators$DistinctAccumulator.add(Accumulators.java:1352)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$AccumulatorWrapperImpl.add(AccumulatorsFactory.java:326)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode$Grouping.addOnMapper(HashAggregateNode.java:306)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode$Grouping.add(HashAggregateNode.java:277)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode.push(HashAggregateNode.java:130)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.FilterNode.filter(FilterNode.java:127)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.FilterNode.push(FilterNode.java:82)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.TableSpoolNode.doPush(TableSpoolNode.java:111)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.TableSpoolNode.push(TableSpoolNode.java:146)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.pushUnordered(Inbox.java:304)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.push(Inbox.java:203)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.doPush(Inbox.java:184)
      

      Calcite can create `AggregateCall` with empty `getArgList()`.

      Adoption of #IGNITE-19401

      Attachments

        Issue Links

          Activity

            People

              vladsz83 Vladimir Steshin
              vladsz83 Vladimir Steshin
              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 - 50m
                  50m