Skip to content

Add append_n method to FixedSizeBinaryDictionaryBuilder #8497

@albertlockett

Description

@albertlockett

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I am writing some code that appends multiple of the same value to the FixedSizeDictinoaryBuilder

Describe the solution you'd like
In GenericByteDictionaryBuilder, we have a helpful method called append_n, which can save us multiple key lookups:

/// Append a value multiple times to the array.
/// This is the same as `append` but allows to append the same value multiple times without doing multiple lookups.
///
/// Returns an error if the new index would overflow the key type.
pub fn append_n(
&mut self,
value: impl AsRef<T::Native>,
count: usize,
) -> Result<K::Native, ArrowError> {
let key = self.get_or_insert_key(value)?;
self.keys_builder.append_value_n(key, count);
Ok(key)
}

I would like it if the FixedSizeDictinoaryBuilder had a similar method.

Describe alternatives you've considered

for _ in 0..count {
    builder.append_slice(val)?;
}

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions