-
Notifications
You must be signed in to change notification settings - Fork 25.6k
SQL: Fix LIMIT bug in agg sorting #41258
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
When specifying a limit over an agg sorting, the limit will be pushed down to the grouping which affects the custom sorting. This commit fixes that and restricts the limit only to sorting. Fix elastic#40984
|
Pinging @elastic/es-search |
astefan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
One small picky comment: if I'm not mistaken the query from the original issue is not in the tests? Indeed, there are many variants, but that specific one is not there, something like SELECT gender g, count(*) total FROM test_emp GROUP BY g ORDER BY total desc LIMIT 5.
|
@astefan no but it's one quite close to it: |
matriv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When specifying a limit over an agg sorting, the limit will be pushed down to the grouping which affects the custom sorting. This commit fixes that and restricts the limit only to sorting. Fix elastic#40984
When specifying a limit over an agg sorting, the limit will be pushed
down to the grouping which affects the custom sorting. This commit fixes
that and restricts the limit only to sorting.
Fix #40984