thinkharderdev commented on PR #15149: URL: https://github.com/apache/datafusion/pull/15149#issuecomment-2739947657
> > I recommend following whatever DuckDB (or postgres do) -- there is not muchv alue in DataFusion having different semantics from other systems > > * DuckDB doesn't have union for arrays: https://duckdb.org/docs/stable/sql/functions/list.html > > * `list_intersect` is not commutative in DuckDB (I would consider this a bug) > * `select list_intersect(NULL, [1,2,3]);` returns null > * `select list_intersect([1,2,3], NULL);` returns empty list > * Postgres has neither union, not intersect for arrays: https://www.postgresql.org/docs/current/functions-array.html I agree that it should be commutative. In PG at least `array_cat` is commutative with `array_cat(ARRAY[1,2,3],NULL) <=> array_cat(NULL, ARRAY[1,2,3]) <=> {1,2,3}` So I would voter for `list_intersect` with `NULL` arg to return empty list. -- 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