-
Notifications
You must be signed in to change notification settings - Fork 608
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
feat(api): support order_by
in order-sensitive aggregates (collect
/group_concat
/first
/last
)
#9729
Conversation
I don't have cloud testing setup locally, so I'm 🤞 that I did everything correctly for bigquery/snowflake. |
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.
Thanks!
One concern about ignoring filters with literal inputs.
There's a couple things that can be pulled out here, I'll do a couple separate PRs.
|
79626db
to
773d7fe
Compare
141a263
to
b906201
Compare
…`/`group_concat`/`first`/`last`)
I think there's probably an argument to be made for adding |
b906201
to
b9f2b19
Compare
Sweet, thanks @jcrist! Merging. |
This adds a new
order_by
keyword argument to order-sensitive aggregates (collect
/group_concat
/first
/last
) to specify the ordering the aggregation should use. By default no ordering is specified, and the result is backend dependent (following the current behavior).This is generally implemented using either an aggregate-internal
ORDER BY
clause, or viaWITHIN GROUP (...)
(backend dependent). The SQL required here can vary significantly between backends unfortunately :/.Fixes #9170.