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 2020/12/06 10:23:58 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #8850: ARROW-10591: [Rust] Add support for StructArray to MutableArrayData

Dandandan commented on a change in pull request #8850:
URL: https://github.com/apache/arrow/pull/8850#discussion_r537007642



##########
File path: rust/arrow/src/array/transform/mod.rs
##########
@@ -285,10 +288,16 @@ impl<'a> MutableArrayData<'a> {
     /// `use_nulls` is a flag used to optimize insertions. It should be `false` if the only source of nulls
     /// are the arrays themselves and `true` if the user plans to call [MutableArrayData::extend_nulls].
     /// In other words, if `use_nulls` is `false`, calling [MutableArrayData::extend_nulls] should not be used.
-    pub fn new(arrays: Vec<&'a ArrayData>, use_nulls: bool, capacity: usize) -> Self {
+    pub fn new(arrays: Vec<&'a ArrayData>, mut use_nulls: bool, capacity: usize) -> Self {
         let data_type = arrays[0].data_type();
         use crate::datatypes::*;
 
+        // if any of the arrays has nulls, insertions from any array requires setting bits

Review comment:
       Maybe this code could move to the struct branch in the match below?




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

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