gabotechs opened a new pull request, #14412: URL: https://github.com/apache/datafusion/pull/14412
## Which issue does this PR close? Closes #8260. ## Rationale for this change Complete the missing functionality of the STRING_AGG function. ## What changes are included in this PR? Adds support for DISTINCT and ORDER_BY clauses by reusing the existing ARRAY_AGG functionality and building the whole STRING_AGG aggregation function on top of it. This way, the full STRING_AGG functionality is automatically implemented [almost] for free. The rationale for reusing the ARRAY_AGG functionality is because both functions are very similar, with just two minor diferences: - STRING_AGG works only with strings, while ARRAY_AGG works with any type. - The return of STRING_AGG is the same as ARRAY_AGG, but with the resulting array of strings joined by a delimiter. In order to have the full STRING_AGG functionality, some small addition is also needed for the ARRAY_AGG function, as the current implementation is missing support for DISTINCT + ORDER BY. See <insert PR>. ## Are these changes tested? Yes, both in unit tests and sqllogictests. ## Are there any user-facing changes? Users will be able to issue STRING_AGG calls with 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