davidlghellin opened a new issue, #19735: URL: https://github.com/apache/datafusion/issues/19735
### Describe the bug When using `array_agg` (or `ARRAY_AGG`) with both `DISTINCT` and `IGNORE NULLS` clauses, the `IGNORE NULLS` clause is not being respected. NULL values are included in the result even when they should be filtered out. ### To Reproduce ```sql SELECT ARRAY_AGG(DISTINCT x IGNORE NULLS) as result FROM (VALUES (1), (2), (NULL), (2), (NULL), (1)) AS t(x); ``` ### Expected behavior ```` > SELECT ARRAY_AGG(DISTINCT x IGNORE NULLS) as result FROM (VALUES (1), (2), (NULL), (2), (NULL), (1)) AS t(x); +--------+ | result | +--------+ | [2, 1] | +--------+ ``` ### Additional context DISTINCT and IGNORE NULLS <img width="458" height="288" alt="Image" src="https://github.com/user-attachments/assets/1db0f6cd-a874-4e72-a6f5-2283851576be" /> IGNORE NULLS <img width="438" height="140" alt="Image" src="https://github.com/user-attachments/assets/66ad6192-1a25-4a51-9f07-83adfa598f28" /> Testing ibis from Sail https://github.com/lakehq/sail/pull/1187 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
