nuno-faria commented on code in PR #23382:
URL: https://github.com/apache/datafusion/pull/23382#discussion_r3546514323


##########
datafusion/sqllogictest/test_files/array/array_has.slt:
##########
@@ -41,13 +41,11 @@ select array_has([1, null, 2], 3),
 false false
 
 #TODO: array_has_all and array_has_any cannot handle NULL
-#query BBBB
-#select array_has_any([], null),
-#       array_has_any([1, 2, 3], null),
-#       array_has_all([], null),
-#       array_has_all([1, 2, 3], null);
-#----
-#false false false false
+query error array_has does not support type 'Null'
+select array_has_any([], null),
+       array_has_any([1, 2, 3], null),
+       array_has_all([], null),
+       array_has_all([1, 2, 3], null);

Review Comment:
   Should these return null, like the `select array_distinct(null);` above or 
like in DuckDB? If so, we could split this into two tests, since 
`array_has_any` already does not return an error.



##########
datafusion/sqllogictest/test_files/array/array_index.slt:
##########


Review Comment:
   This test works if we convert `[2 | 2:10]` to `[(2 | 2):10]`:
   
   ```sql
   > select make_array(1, 2, 3)[2 + 1 - 1:10], make_array(1.0, 2.0, 3.0)[(2 | 
2):10], make_array('h', 'e', 'l', 'l', 'o')[6 ^ 6:10];
   
+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
   | make_array(Int64(1),Int64(2),Int64(3))[Int64(2) + Int64(1) - 
Int64(1):Int64(10):Int64(1)] | 
make_array(Float64(1),Float64(2),Float64(3))[Int64(2) | 
Int64(2):Int64(10):Int64(1)] | 
make_array(Utf8("h"),Utf8("e"),Utf8("l"),Utf8("l"),Utf8("o"))[Int64(6) BIT_XOR 
Int64(6):Int64(10):Int64(1)] |
   
+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
   | [2, 3]                                                                     
               | [2.0, 3.0]                                                     
                      | [h, e, l, l, o]                                         
                                                    |
   
+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
   ```
   
   I don't know if the idea is for it to work without them.



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