-
Notifications
You must be signed in to change notification settings - Fork 25k
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
SQL: Verifier allows aliases aggregates for sorting #34773
Conversation
Pinging @elastic/es-search-aggs |
Improve Verifier rule that prevented grouping, aliases inside aggregates to not be accepted for ordering. Close elastic#34607
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. Left a comment.
@@ -110,6 +118,11 @@ public void testGroupByOrderByNonGrouped() { | |||
verify("SELECT MAX(int) FROM test GROUP BY text ORDER BY bool")); | |||
} | |||
|
|||
public void testGroupByOrderByAliasedInSelectAllowed() { | |||
LogicalPlan lp = accepted("SELECT text t FROM test GROUP BY text ORDER BY t"); |
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.
You don't group by the alias t
but you use text
, was that the intention? Because here you use the alias: https://github.com/elastic/elasticsearch/pull/34773/files#diff-3d7c2dc164e7f948316c325f88c12a3fR39
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.
The verifier query is correct, the sql isn't (it's a typo). Fixing this in a follow-up commit.
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
Improve Verifier rule that prevented grouping with aliases inside aggregates to not be accepted for ordering. Close #34607
Improve Verifier rule that prevented grouping, aliases inside aggregates
to not be accepted for ordering.
Close #34607