请解释在kibana控制台中从sql查询翻译的逻辑。最令人困惑的是“order”:“asc”,而我请求 desc。
数字“10985”和“11030”看起来也很奇怪。如果我重新运行翻译,这些数字会发生变化。
我做一个查询翻译:
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"
}
翻译:
{
"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"
}
}
}
}
}
}