crepererum commented on code in PR #7313:
URL: https://github.com/apache/arrow-datafusion/pull/7313#discussion_r1301331252
##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -986,6 +986,26 @@ macro_rules! general_repeat_list {
}};
}
+/// Array_empty SQL function
+pub fn array_empty(args: &[ArrayRef]) -> Result<ArrayRef> {
+ if args[0].as_any().downcast_ref::<NullArray>().is_some() {
Review Comment:
I think this doesn't catch all nulls. This only works within the test setup
because `array_empty(NULL)` creates a NULL array. I think this will fail w/:
```sql
SELECT array_empty(a)
FROM VALUES(NULL, make_array(), make_array(1)) sub (a);
```
I suggest you remove this check and change the else part within
`array.iter().map(...)` to `None` (from `Some(true)`).
--
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]