Elasticsearch Version
main
Installed Plugins
No response
Java Version
n/a
OS Version
n/a
Problem Description
The following ES|QL query gives incorrect results:
ROW x = [1,2,3,4]
| MV_EXPAND x
| STATS top1 = TOP(x, 1, "ASC") WHERE x==3,
top2 = TOP(x, 2, "ASC") WHERE x==3,
min = MIN(x) WHERE x==3
The three aggs should give the same result (3), however the results are:
top1 | top2 | min
---------------+---------------+---------------
1 |3 |3
Note that:
top2 is effectively the same as top1 here and correctly works
top1 has min as surrogate, however something goes wrong there
min itself is correct
Steps to Reproduce
see above
Logs (if relevant)
No response
Elasticsearch Version
main
Installed Plugins
No response
Java Version
n/a
OS Version
n/a
Problem Description
The following ES|QL query gives incorrect results:
The three aggs should give the same result (3), however the results are:
Note that:
top2is effectively the same astop1here and correctly workstop1hasminas surrogate, however something goes wrong thereminitself is correctSteps to Reproduce
see above
Logs (if relevant)
No response