Weijun-H commented on code in PR #8516:
URL: https://github.com/apache/arrow-datafusion/pull/8516#discussion_r1429126918


##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -3037,6 +3043,16 @@ select array_intersect([], []);
 ----
 []
 
+query ?
+select array_intersect([1, 1, 2, 2, 3, 3], null);
+----
+[1, 2, 3]
+
+query ?
+select array_intersect(null, [1, 1, 2, 2, 3, 3]);
+----
+[1, 2, 3]

Review Comment:
   > I think we should return empty array or null in this case. DuckDB return 
empty array, Clickhouse return null. I
   
   I check DuckDB results, which are NULL also. @jayzhan211 
   ```
   D select typeof( list_intersect(null, null));
   ┌────────────────────────────────────┐
   │ typeof(list_intersect(NULL, NULL)) │
   │              varchar               │
   ├────────────────────────────────────┤
   │ NULL                               │
   └────────────────────────────────────┘
   D select typeof( list_intersect(null, []));
   ┌─────────────────────────────────────────────────┐
   │ typeof(list_intersect(NULL, main.list_value())) │
   │                     varchar                     │
   ├─────────────────────────────────────────────────┤
   │ NULL                                            │
   └─────────────────────────────────────────────────┘
   ```



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

Reply via email to