pub struct DictionaryEncoding { /* private fields */ }Expand description
A dictionary-encoded string column.
Stores unique strings in a dictionary and references them by integer codes.
Implementations§
Source§impl DictionaryEncoding
impl DictionaryEncoding
Sourcepub fn new(dictionary: Arc<[Arc<str>]>, codes: Vec<u32>) -> Self
pub fn new(dictionary: Arc<[Arc<str>]>, codes: Vec<u32>) -> Self
Creates a new dictionary encoding from a dictionary and codes.
Sourcepub fn with_nulls(self, null_bitmap: Vec<u64>) -> Self
pub fn with_nulls(self, null_bitmap: Vec<u64>) -> Self
Creates a dictionary encoding with a null bitmap.
Sourcepub fn dictionary_size(&self) -> usize
pub fn dictionary_size(&self) -> usize
Returns the number of unique strings in the dictionary.
Sourcepub fn dictionary(&self) -> &Arc<[Arc<str>]>
pub fn dictionary(&self) -> &Arc<[Arc<str>]>
Returns the dictionary.
Sourcepub fn get(&self, index: usize) -> Option<&str>
pub fn get(&self, index: usize) -> Option<&str>
Returns the string value at the given index.
Returns None if the value is null.
Sourcepub fn iter(&self) -> impl Iterator<Item = Option<&str>>
pub fn iter(&self) -> impl Iterator<Item = Option<&str>>
Iterates over all values, yielding Option<&str>.
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Returns the compression ratio (original size / compressed size).
A ratio > 1.0 means compression is effective.
Trait Implementations§
Source§impl Clone for DictionaryEncoding
impl Clone for DictionaryEncoding
Source§fn clone(&self) -> DictionaryEncoding
fn clone(&self) -> DictionaryEncoding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DictionaryEncoding
impl RefUnwindSafe for DictionaryEncoding
impl Send for DictionaryEncoding
impl Sync for DictionaryEncoding
impl Unpin for DictionaryEncoding
impl UnwindSafe for DictionaryEncoding
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