gabotechs opened a new pull request, #14413: URL: https://github.com/apache/datafusion/pull/14413
## Which issue does this PR close? Closes #12371. ## Rationale for this change Completing ARRAY_AGG functionality as a prerequisite for adding the full functionality of STRING_AGG in https://github.com/apache/datafusion/pull/14412 ## What changes are included in this PR? Adds a Postgres-style support for DISTINCT + ORDER_BY functionality, allowing users to issue statements like: ```sql SELECT ARRAY_AGG(DISTINCT col ORDER BY col) FROM table; ``` Note that there's a limitation that prohibits ordering by an expression that is not the same as the ARRAY_AGG argument. For example, the following queries are invalid: ```sql SELECT ARRAY_AGG(DISTINCT col ORDER BY other_col) FROM table; SELECT ARRAY_AGG(DISTINCT col ORDER BY concat(col, '')) FROM table; ``` ## Are these changes tested? yes, both in unit tests and sqllogictests ## Are there any user-facing changes? Users will now be able to issue ARRAY_AGG calls mixing DISTINCT and ORDER_BY clauses -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org