izveigor commented on code in PR #7313:
URL: https://github.com/apache/arrow-datafusion/pull/7313#discussion_r1297412409


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -986,6 +986,36 @@ macro_rules! general_repeat_list {
     }};
 }
 
+/// Array_empty SQL function
+pub fn array_empty(args: &[ArrayRef]) -> Result<ArrayRef> {
+    let array = as_list_array(&args[0])?;
+    let mut builder = UInt8Array::builder(1);
+
+    for arr in array.iter() {

Review Comment:
   I don't like using `builder` method for array functions. I think you can use 
`map` method and collect the results as `BooleanArray`:
   
   It seems to me like:
   ```suggestion
       array.iter().map(|arr| arr.is_empty()).collect::<BooleanArray>()
   ```
   P.S. `arr` is `Option`, so you should consider `None` case too.



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