gabotechs commented on code in PR #15544: URL: https://github.com/apache/datafusion/pull/15544#discussion_r2026317591
########## datafusion/sqllogictest/test_files/aggregate.slt: ########## @@ -3194,6 +3196,28 @@ select array_agg(column1) from t; statement ok drop table t; +# array_agg_ignore_nulls +statement ok +create table t as values (NULL, ''), (1, 'c'), (2, 'a'), (NULL, 'b'), (4, NULL), (NULL, NULL), (5, 'a'); + +query ? +select array_agg(column1) ignore nulls as c1 from t; +---- +[1, 2, 4, 5] + +query II +select count(*), array_length(array_agg(distinct column2) ignore nulls) from t; +---- +7 4 + +query ? +select array_agg(column2 order by column1) ignore nulls from t; +---- +[c, a, a, , b] + +statement ok +drop table t; + Review Comment: For the sake of completeness, how about adding this other test that mixes DISTINCT with ORDER BY: ```sql query ? select array_agg(DISTINCT column2 order by column2) ignore nulls from t; ---- [, a, b, c] ``` -- 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