tustvold commented on code in PR #6534:
URL: https://github.com/apache/arrow-rs/pull/6534#discussion_r1794285686
##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
@@ -267,6 +294,23 @@ where
};
}
+ /// Append an `Option` value into the builder repeatedly `count` times.
+ /// This is the same as `append_option` but allows to append the same
value multiple times without doing multiple lookups.
+ ///
+ /// # Panics
+ ///
+ /// Panics if the resulting length of the dictionary values array would
exceed `T::Native::MAX`
+ pub fn append_option_many(&mut self, value: Option<impl AsRef<T::Native>>,
count: usize) {
+ match value {
+ None => {
+ for _ in 0..count {
Review Comment:
https://docs.rs/arrow-array/latest/arrow_array/builder/struct.PrimitiveBuilder.html#method.append_nulls
will be significantly faster
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]