-
Notifications
You must be signed in to change notification settings - Fork 25.2k
SQL: Verify GROUP BY ordering on grouped columns #30585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Due to the way composite aggregation works, ordering in GROUP BY can be applied only through grouped columns which now the analyzer verifier enforces. Fix 29900
Pinging @elastic/es-search-aggs |
Due to the way composite aggregation works, ordering in GROUP BY can be applied only through grouped columns which now the analyzer verifier enforces. Fix 29900
Due to the way composite aggregation works, ordering in GROUP BY can be applied only through grouped columns which now the analyzer verifier enforces. Fix 29900
Ran into this today, and tried this as a workaround: SELECT *
FROM (
SELECT app.name, SUM(duration) AS total_duration
FROM qbserve
WHERE category.productivity = 1
GROUP BY app.name
)
ORDER BY total_duration DESC Didn't get an error, but the results also weren't sorted. 🤷♂️ Does this mean this is still an issue? |
For the posterity: no, besides grouped field, ordering by an agg function (like |
Due to the way composite aggregation works, ordering in GROUP BY can be
applied only through grouped columns which now the analyzer verifier
enforces.
Fix #29900