comphead commented on code in PR #9141:
URL: https://github.com/apache/arrow-datafusion/pull/9141#discussion_r1480800735


##########
datafusion/common/src/scalar.rs:
##########
@@ -1385,24 +1385,37 @@ impl ScalarValue {
                 .map(|s| s.to_array())
                 .collect::<Result<Vec<_>>>()?;
 
-            let capacity = Capacities::Array(arrays.iter().map(|arr| 
arr.len()).sum());
+            let capacity = Capacities::Array(
+                arrays
+                    .iter()

Review Comment:
   was thinking if filter_map will be handy here to avoid double iteration? 
   
   ```
   arrays.iter().filter_map(|arr| {if arr.is_null(0) {None} else 
Some(arr.len()) })



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