This repository was archived by the owner on Aug 2, 2022. It is now read-only. 
 -   Notifications  
You must be signed in to change notification settings  - Fork 188
 
 This repository was archived by the owner on Aug 2, 2022. It is now read-only. 
 aggregates over functions almost work #288
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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
Labels
enhancementNew feature or requestNew feature or request