feniljain commented on PR #19415:
URL: https://github.com/apache/datafusion/pull/19415#issuecomment-3677969443

   For `array_union` I checked behaviour of spark:
   ```
   spark-sql (default)> select array_union(cast(null as array<string>), 
array());
   NULL
   Time taken: 0.693 seconds, Fetched 1 row(s)
   spark-sql (default)> select array_intersect(cast(null as array<string>), 
cast(null as array<string>));
   NULL
   Time taken: 0.058 seconds, Fetched 1 row(s)
   spark-sql (default)> select array_intersect(array(), cast(null as 
array<string>));
   NULL
   Time taken: 0.075 seconds, Fetched 1 row(s)
   spark-sql (default)> select array_intersect(array(), array());
   []
   Time taken: 0.071 seconds, Fetched 1 row(s)
   ```
   
   Seems consistent with above result: `If either array is null, it returns 
null`
   
   And current behaviour of `array_union` with this PR:
   ```
   query ?
   select array_union(column1, column2)
   from array_intersect_table_1D_NULL;
   ----
   [1, 2, 3, 4]
   [2, 3]
   [3, 4]
   [3, 4]
   [1, 2]
   []
   ```
   
   i.e. follows array same like `array_intersect`


-- 
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]

Reply via email to