You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/29 14:38:02 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3227: Zero out child null mask in new_null_array for StructArray

tustvold commented on code in PR #3227:
URL: https://github.com/apache/arrow-rs/pull/3227#discussion_r1034839270


##########
arrow-array/src/array/mod.rs:
##########
@@ -702,14 +702,31 @@ pub fn new_null_array(data_type: &DataType, length: usize) -> ArrayRef {
                 ],
             )
         }),
-        DataType::Struct(fields) => {
-            let fields: Vec<_> = fields
+        d @ DataType::Struct(fields) => {
+            let child_data = fields
                 .iter()
-                .map(|field| (field.clone(), new_null_array(field.data_type(), length)))
+                .map(|field| {
+                    // Nulls are encoded in the parent StructArray instead, otherwise this

Review Comment:
   This does create an interesting problem for dictionaries, where the resulting child data is technically ill-formed now. I'm not really sure what can be done about this



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org