bjchambers commented on a change in pull request #736:
URL: https://github.com/apache/arrow-rs/pull/736#discussion_r700421525



##########
File path: arrow/src/array/array.rs
##########
@@ -448,18 +448,15 @@ pub fn new_null_array(data_type: &DataType, length: 
usize) -> ArrayRef {
                     .clone(),
             ],
         )),
-        DataType::Struct(fields) => make_array(ArrayData::new(
-            data_type.clone(),
-            length,
-            Some(length),
-            Some(MutableBuffer::new_null(length).into()),
-            0,
-            vec![],
-            fields
+        DataType::Struct(fields) => {
+            let fields: Vec<_> = fields
                 .iter()
-                .map(|field| ArrayData::new_empty(field.data_type()))
-                .collect(),
-        )),
+                .map(|field| (field.clone(), new_null_array(field.data_type(), 
length)))

Review comment:
       One concern I have is that this creates a new null array for the field 
even if the field was non-nullable. I *think* that is OK because the enclosing 
`struct` is null at all those points, but wasn't 100% sure.




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