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/07/22 07:37:18 UTC

[GitHub] [arrow-rs] viirya commented on a diff in pull request #2127: Lazily materialize the null buffer builder for all array builders.

viirya commented on code in PR #2127:
URL: https://github.com/apache/arrow-rs/pull/2127#discussion_r927376511


##########
arrow/src/array/builder/boolean_builder.rs:
##########
@@ -85,17 +84,19 @@ impl BooleanBuilder {
     #[inline]
     pub fn append_value(&mut self, v: bool) {
         self.values_builder.append(v);
-        if let Some(b) = self.bitmap_builder.as_mut() {
-            b.append(true)
-        }
+        self.null_buffer_builder.append_n_true(1);
     }
 
     /// Appends a null slot into the builder
     #[inline]
     pub fn append_null(&mut self) {
-        self.materialize_bitmap_builder();
-        self.bitmap_builder.as_mut().unwrap().append(false);
-        self.values_builder.advance(1);
+        self.append_nulls(1)
+    }
+
+    #[inline]
+    pub fn append_nulls(&mut self, n: usize) {

Review Comment:
   Add a simple doc?



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