This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new be8bd13aed add a validity slice access for boolean array builders 
(#4536)
be8bd13aed is described below

commit be8bd13aedaf4d5880192ddcb40742035d6701c5
Author: Christian Beilschmidt <[email protected]>
AuthorDate: Tue Jul 18 15:42:33 2023 +0200

    add a validity slice access for boolean array builders (#4536)
---
 arrow-array/src/builder/boolean_builder.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arrow-array/src/builder/boolean_builder.rs 
b/arrow-array/src/builder/boolean_builder.rs
index 0def0ec48e..b4283775e6 100644
--- a/arrow-array/src/builder/boolean_builder.rs
+++ b/arrow-array/src/builder/boolean_builder.rs
@@ -169,6 +169,11 @@ impl BooleanBuilder {
         let array_data = unsafe { builder.build_unchecked() };
         BooleanArray::from(array_data)
     }
+
+    /// Returns the current null buffer as a slice
+    pub fn validity_slice(&self) -> Option<&[u8]> {
+        self.null_buffer_builder.as_slice()
+    }
 }
 
 impl ArrayBuilder for BooleanBuilder {

Reply via email to