Skip to content

ES|QL: ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 #136851

@luigidellaquila

Description

@luigidellaquila

With CSV dataset:

./gradlew :x-pack:plugin:esql:qa:testFixtures:loadCsvSpecData --args="http://elastic-admin:elastic-password@localhost:9200"
from countries_bbox_web | limit 307 | drop `id` | drop name | inline stats  `shape` = count(*), UKmoYKgHt = count(*), jEHxaMcLul = count(*), VRjIowfF = count(*) | drop UKmoYKgHt, UKmoYKgH*, shape | FORK  (where  NOT true) (where  NOT false) (where  NOT VRjIowfF >= 50) (where jEHxaMcLul > 50 AND true | where  NOT false AND jEHxaMcLul == 50  | where false OR false OR  NOT false AND  NOT false) (where false AND  NOT false) | WHERE _fork == "fork3" | DROP _fork | stats  oYhFLywK = avg(VRjIowfF) + count(VRjIowfF) + max(VRjIowfF), sygFReMcRSnf = count(*), WmxejCVu = count(*), REnkUKYklmVO = absent(VRjIowfF + VRjIowfF), `VRjIowfF` = values(VRjIowfF + jEHxaMcLul + VRjIowfF) by VRjIowfF
{
    "error": {
        "root_cause": [
            {
                "type": "array_index_out_of_bounds_exception",
                "reason": "Index 0 out of bounds for length 0"
            }
        ],
        "type": "array_index_out_of_bounds_exception",
        "reason": "Index 0 out of bounds for length 0"
    },
    "status": 500
}
Error running driver [final] java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at org.elasticsearch.compute.data.Page.getBlock(Page.java:146)
        at org.elasticsearch.compute.aggregation.CountAggregatorFunction.addRawInput(CountAggregatorFunction.java:86)
        at org.elasticsearch.compute.aggregation.Aggregator.processPage(Aggregator.java:43)
        at org.elasticsearch.compute.operator.AggregationOperator.addInput(AggregationOperator.java:111)
        at org.elasticsearch.compute.operator.Driver.runSingleLoopIteration(Driver.java:294)
        at org.elasticsearch.compute.operator.Driver.run(Driver.java:191)
        at org.elasticsearch.compute.operator.Driver$1.doRun(Driver.java:428)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at org.elasticsearch.compute.operator.DriverScheduler$1.doRun(DriverScheduler.java:57)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at [email protected]/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:35)
        at [email protected]/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1076)
        at [email protected]/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions