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 021c21698f Add append_nulls to dictionary builders (#6542)
021c21698f is described below
commit 021c21698f9b76ca90e8e40a846c9d6db188e46a
Author: Adrian Garcia Badaracco <[email protected]>
AuthorDate: Fri Oct 11 05:48:28 2024 -0500
Add append_nulls to dictionary builders (#6542)
* Add append_nulls to dictionary builders
* Update arrow-array/src/builder/generic_bytes_dictionary_builder.rs
Co-authored-by: Kyle Barron <[email protected]>
---------
Co-authored-by: Kyle Barron <[email protected]>
---
arrow-array/src/builder/generic_bytes_dictionary_builder.rs | 6 ++++++
arrow-array/src/builder/primitive_dictionary_builder.rs | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/arrow-array/src/builder/generic_bytes_dictionary_builder.rs
b/arrow-array/src/builder/generic_bytes_dictionary_builder.rs
index a327c622a7..bb0fb5e91b 100644
--- a/arrow-array/src/builder/generic_bytes_dictionary_builder.rs
+++ b/arrow-array/src/builder/generic_bytes_dictionary_builder.rs
@@ -273,6 +273,12 @@ where
self.keys_builder.append_null()
}
+ /// Infallibly append `n` null slots into the builder
+ #[inline]
+ pub fn append_nulls(&mut self, n: usize) {
+ self.keys_builder.append_nulls(n)
+ }
+
/// Append an `Option` value into the builder
///
/// # Panics
diff --git a/arrow-array/src/builder/primitive_dictionary_builder.rs
b/arrow-array/src/builder/primitive_dictionary_builder.rs
index 35abe5ba5f..ac40f8a469 100644
--- a/arrow-array/src/builder/primitive_dictionary_builder.rs
+++ b/arrow-array/src/builder/primitive_dictionary_builder.rs
@@ -271,6 +271,12 @@ where
self.keys_builder.append_null()
}
+ /// Append `n` null slots into the builder
+ #[inline]
+ pub fn append_nulls(&mut self, n: usize) {
+ self.keys_builder.append_nulls(n)
+ }
+
/// Append an `Option` value into the builder
///
/// # Panics