Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

aggregates over functions almost work #288

@galkk

Description

@galkk

Seems like the fix should be relatively simple, given that it generates aggregation correctly and only return in generated script is missing

POST /_opendistro/_sql/_explain { "query":"""SELECT max(log(FlightDelayMin)) FROM kibana_sample_data_flights GROUP BY DestCountry, dayOfWeek """ } 
{ "from" : 0, "size" : 0, "_source" : { "includes" : [ "MAX" ], "excludes" : [ ] }, "aggregations" : { "DestCountry" : { "terms" : { "field" : "DestCountry", "size" : 200, "min_doc_count" : 1, "shard_min_doc_count" : 0, "show_term_doc_count_error" : false, "order" : [ { "_count" : "desc" }, { "_key" : "asc" } ] }, "aggregations" : { "dayOfWeek" : { "terms" : { "field" : "dayOfWeek", "size" : 10, "min_doc_count" : 1, "shard_min_doc_count" : 0, "show_term_doc_count_error" : false, "order" : [ { "_count" : "desc" }, { "_key" : "asc" } ] }, "aggregations" : { "MAX(log_1=def log_1 = Math.log(doc('FlightDelayMin').value)/Math.log(Math.E))" : { "max" : { MISSING RETURN HERE, THAT"S IT "script" : { "source" : "def log_1 = Math.log(doc['FlightDelayMin'].value)/Math.log(Math.E)", "lang" : "painless" } } } } } } } } } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions