[−][src]Struct arrow::array::PrimitiveDictionaryBuilder
Array builder for DictionaryArray
. For example to map a set of byte indices
to f32 values. Note that the use of a HashMap
here will not scale to very large
arrays or result in an ordered dictionary.
Implementations
impl<K, V> PrimitiveDictionaryBuilder<K, V> where
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
[src]
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
pub fn new(
keys_builder: PrimitiveBuilder<K>,
values_builder: PrimitiveBuilder<V>
) -> Self
[src]
keys_builder: PrimitiveBuilder<K>,
values_builder: PrimitiveBuilder<V>
) -> Self
Creates a new PrimitiveDictionaryBuilder
from a keys builder and a value builder.
impl<K, V> PrimitiveDictionaryBuilder<K, V> where
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
[src]
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
pub fn append(&mut self, value: V::Native) -> Result<K::Native>
[src]
Append a primitive value to the array. Return an existing index if already present in the values array or a new index if the value is appended to the values array.
pub fn append_null(&mut self) -> Result<()>
[src]
pub fn finish(&mut self) -> DictionaryArray<K>
[src]
Builds the DictionaryArray
and reset this builder.
Trait Implementations
impl<K, V> ArrayBuilder for PrimitiveDictionaryBuilder<K, V> where
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
[src]
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
fn as_any(&self) -> &dyn Any
[src]
Returns the builder as an non-mutable Any
reference.
fn as_any_mut(&mut self) -> &mut dyn Any
[src]
Returns the builder as an mutable Any
reference.
fn into_box_any(self: Box<Self>) -> Box<dyn Any>
[src]
Returns the boxed builder as a box of Any
.
fn len(&self) -> usize
[src]
Returns the number of array slots in the builder
fn is_empty(&self) -> bool
[src]
Returns whether the number of array slots is zero
fn append_data(&mut self, _data: &[ArrayDataRef]) -> Result<()>
[src]
Appends data from other arrays into the builder
This is most useful when concatenating arrays of the same type into a builder.
fn data_type(&self) -> DataType
[src]
Returns the data type of the builder
This is used for validating array data types in append_data
fn finish(&mut self) -> ArrayRef
[src]
Builds the array and reset this builder.
impl<K: Debug, V: Debug> Debug for PrimitiveDictionaryBuilder<K, V> where
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
K::Native: Debug,
[src]
K: ArrowPrimitiveType,
V: ArrowPrimitiveType,
K::Native: Debug,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for PrimitiveDictionaryBuilder<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
<K as ArrowPrimitiveType>::Native: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
<K as ArrowPrimitiveType>::Native: RefUnwindSafe,
impl<K, V> Send for PrimitiveDictionaryBuilder<K, V> where
K: Send,
V: Send,
<K as ArrowPrimitiveType>::Native: Send,
K: Send,
V: Send,
<K as ArrowPrimitiveType>::Native: Send,
impl<K, V> Sync for PrimitiveDictionaryBuilder<K, V> where
K: Sync,
V: Sync,
<K as ArrowPrimitiveType>::Native: Sync,
K: Sync,
V: Sync,
<K as ArrowPrimitiveType>::Native: Sync,
impl<K, V> Unpin for PrimitiveDictionaryBuilder<K, V> where
K: Unpin,
V: Unpin,
<K as ArrowPrimitiveType>::Native: Unpin,
K: Unpin,
V: Unpin,
<K as ArrowPrimitiveType>::Native: Unpin,
impl<K, V> UnwindSafe for PrimitiveDictionaryBuilder<K, V> where
K: UnwindSafe,
V: UnwindSafe,
<K as ArrowPrimitiveType>::Native: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
<K as ArrowPrimitiveType>::Native: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,