struct KeyArrayCache<K: ArrowDictionaryKeyType> {
cache: Option<(usize, bool, PrimitiveArray<K>)>,
}Expand description
Cache for dictionary key arrays to avoid repeated allocations when the same size is used frequently.
Similar to PartitionColumnProjector’s ZeroBufferGenerators, this cache stores key arrays for different dictionary key types. The cache is limited to 1 entry per type (the last size used) to prevent memory leaks for extremely large array requests.
Fields§
§cache: Option<(usize, bool, PrimitiveArray<K>)>Implementations§
Source§impl<K: ArrowDictionaryKeyType> KeyArrayCache<K>
impl<K: ArrowDictionaryKeyType> KeyArrayCache<K>
Sourcefn get_or_create(&mut self, num_rows: usize, is_null: bool) -> PrimitiveArray<K>
fn get_or_create(&mut self, num_rows: usize, is_null: bool) -> PrimitiveArray<K>
Get or create a cached key array for the given number of rows and null status
Sourcefn create_key_array(&self, num_rows: usize, is_null: bool) -> PrimitiveArray<K>
fn create_key_array(&self, num_rows: usize, is_null: bool) -> PrimitiveArray<K>
Create a new key array with the specified number of rows and null status
Trait Implementations§
Source§impl<K: Debug + ArrowDictionaryKeyType> Debug for KeyArrayCache<K>
impl<K: Debug + ArrowDictionaryKeyType> Debug for KeyArrayCache<K>
Auto Trait Implementations§
impl<K> Freeze for KeyArrayCache<K>
impl<K> RefUnwindSafe for KeyArrayCache<K>where
<K as ArrowPrimitiveType>::Native: RefUnwindSafe,
impl<K> Send for KeyArrayCache<K>
impl<K> Sync for KeyArrayCache<K>
impl<K> Unpin for KeyArrayCache<K>where
<K as ArrowPrimitiveType>::Native: Unpin,
impl<K> UnwindSafe for KeyArrayCache<K>where
<K as ArrowPrimitiveType>::Native: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more