elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.53k stars 24.61k forks source link

ESQL: Ordinals grouping operator's status has default toStrings in it #111674

Open nik9000 opened 1 month ago

nik9000 commented 1 month ago

Description

The status and profile for when ESQL groups on ordinals looks like:

{"operator":"OrdinalsGroupingOperator[aggregators=[org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier$2@798e0d19, org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier$2@f58d3d6]]"}

It should look more like:

Aggregator[aggregatorFunction=CountAggregatorFunction[channels=[1]

We're letting the toString for a closure slip in to something we're using for debug output.

I used the nyc_taxis data set from rally to get this and ran:

curl -s -uelastic:password -HContent-Type:application/json localhost:9200/_query?pretty -d'{
  "query": "FROM nyc_taxis | INLINESTATS avg=AVG(total_amount) BY payment_type | KEEP total_amount, avg, payment_type | WHERE total_amount > avg | LIMIT 2",
    "pragma": {
        "data_partitioning": "shard"
    },
    "profile": true
}' | jq -c .profile.drivers[]
elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)