pub struct SharedDictionary { /* private fields */ }Expand description
The values of a dictionary that DictionaryColumns index into, such as the dictionary page
of a parquet column chunk.
The values need not be unique: equal codes mean equal values, but different codes may also.
Implementations§
Sourcepub fn new(values: BinaryViewArrayGeneric<str>) -> Arc<SharedDictionary> ⓘ
pub fn new(values: BinaryViewArrayGeneric<str>) -> Arc<SharedDictionary> ⓘ
The values must not contain nulls.
Sourcepub fn code_of(&self, value: &str) -> Option<u32>
pub fn code_of(&self, value: &str) -> Option<u32>
The first code of value, if the dictionary holds it. The lookup table is built on the
first call and kept with the dictionary.
Sourcepub fn extended(&self, added: &[&str]) -> Arc<SharedDictionary> ⓘ
pub fn extended(&self, added: &[&str]) -> Arc<SharedDictionary> ⓘ
A new dictionary of these values followed by added, none of which this one holds. It
shares these values’ buffers, and extends the lookup table and the cached hashes instead of
computing them again.
pub fn id(&self) -> u64
pub fn values(&self) -> &BinaryViewArrayGeneric<str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn cached_hashes(&self, random_state: &RandomState) -> Option<Buffer<u64>>
pub fn cached_hashes(&self, random_state: &RandomState) -> Option<Buffer<u64>>
The hashes Self::hashes gives, if they were already computed.
Trait Implementations§
Auto Trait Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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