append_nulls
and append_trusted_len_iter
for PrimitiveBuilder
#725
Labels
enhancement
Any new improvement worthy of a entry in the changelog
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I have cases where I've identified a range of numbers to add to a builder. Or a number of nulls to add. My only options with the existing PrimitiveBuilder interfaces is to either (a) add each value/null individually or (b) create a vector containing the numbers/nulls I wish to add, and then use
append_values
orappend_slice
.Both of these extra work than is strictly necessary -- in one case, capacity checks after every value and in the other materializing an intermediate vector.
Describe the solution you'd like
pub fn append_nulls(&mut self, num_nulls: usize) -> Result<(), ArrowError>
. Same as callingappend_nulls
num_nulls
times.pub fn append_trusted_len_iter_values(&mut self, iter: impl IntoIterator<T::Native>) -> Result<(), ArrowError>
. Behaves similarly to collecting the items into a vector and then callingappend_slice(&vector)
.Option<T::Native>
.Describe alternatives you've considered
As noted in the description -- multiple calls to
append_value
/append_null
(not ideal due to checking the capacity after each call) or creating a vector and then callingappend_values
orappend_slice
(not ideal due to the need to collect/materialize values first).The text was updated successfully, but these errors were encountered: