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
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
IGNORE NULLS
Testing ibis from Sail
lakehq/sail#1187