You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ORDER BY on array values produces incorrect results #3133
What is the bug?
When a field that contains array values is used in an ORDER BY clause, the comparisons are performed using only the first element of the array values.
How can one reproduce the bug?
Steps to reproduce the behavior:
Create a new index and load the data above
Run the query above on the index
What is the expected behavior?
Comparisons are performed on the array values as a whole. An array comparison is performed element by element until a difference is found.
What is your host/environment?
OS: MacOS X (should not matter)
Version: 3.0 code base
Plugins: SQL plugin
Do you have any screenshots?
N/A
Do you have any additional context?
Issue #1300 had a change recently merged in that allows array values to be used in query evaluation and in the result set.
Activity
normanj-bitquill commentedon Oct 30, 2024
It looks like the OpenSearch engine is doing the sorting, not the SQL plugin.
Using the index and data from the description:
Produces this response:
andrross commentedon Nov 18, 2024
[Catch All Triage - 1, 2, 3, 4, 5]
Fix array comparison to use lexicographic ordering instead of size-only
qianheng-aws commentedon Apr 10, 2026
Closing as duplicate of #5333 — consolidated umbrella issue for array values not treated as atomic values.