Please explain the logic of the query translation from sql in kibana console. The most confusing is "order" : "asc", while i request desc.
The numbers "10985", and "11030" also looks very strange. If I re-run translation these numbers are changing.
I make a query translation:
POST _sql/translate
{
"query": "SELECT day_of_week, avg(taxful_total_price) FROM kibana_sample_data_ecommerce WHERE customer_id = 52 GROUP BY day_of_week ORDER BY avg(taxful_total_price) DESC LIMIT 2"
}
Translation:
{
"size" : 0,
"query" : {
"term" : {
"customer_id" : {
"value" : 52,
"boost" : 1.0
}
}
},
"_source" : false,
"stored_fields" : "_none_",
"aggregations" : {
"groupby" : {
"composite" : {
"size" : 1000,
"sources" : [
{
"10985" : {
"terms" : {
"field" : "day_of_week",
"missing_bucket" : true,
"order" : "asc"
}
}
}
]
},
"aggregations" : {
"11030" : {
"avg" : {
"field" : "taxful_total_price"
}
}
}
}
}
}