pub struct LiquidByteArray { /* private fields */ }Expand description
An array that stores strings in a dictionary format, with a bit-packed array for the keys and a FSST array for the values.
Implementations§
Source§impl LiquidByteArray
impl LiquidByteArray
Sourcepub fn from_bytes(bytes: Bytes, compressor: Arc<Compressor>) -> Self
pub fn from_bytes(bytes: Bytes, compressor: Arc<Compressor>) -> Self
Deserialize a LiquidByteArray from bytes, using zero-copy where possible.
Source§impl LiquidByteArray
impl LiquidByteArray
Sourcepub fn from_string_view_array(
array: &StringViewArray,
compressor: Arc<Compressor>,
) -> Self
pub fn from_string_view_array( array: &StringViewArray, compressor: Arc<Compressor>, ) -> Self
Create a LiquidByteArray from an Arrow StringViewArray.
Sourcepub fn from_binary_view_array(
array: &BinaryViewArray,
compressor: Arc<Compressor>,
) -> Self
pub fn from_binary_view_array( array: &BinaryViewArray, compressor: Arc<Compressor>, ) -> Self
Create a LiquidByteArray from an Arrow BinaryViewArray.
Sourcepub fn train_compressor_bytes<'a, T: ArrayAccessor<Item = &'a [u8]>>(
array: ArrayIter<T>,
) -> Arc<Compressor>
pub fn train_compressor_bytes<'a, T: ArrayAccessor<Item = &'a [u8]>>( array: ArrayIter<T>, ) -> Arc<Compressor>
Train a compressor from an iterator of byte arrays.
Sourcepub fn train_compressor<'a, T: ArrayAccessor<Item = &'a str>>(
array: ArrayIter<T>,
) -> Arc<Compressor>
pub fn train_compressor<'a, T: ArrayAccessor<Item = &'a str>>( array: ArrayIter<T>, ) -> Arc<Compressor>
Train a compressor from an iterator of strings.
Sourcepub fn from_string_array(
array: &StringArray,
compressor: Arc<Compressor>,
) -> Self
pub fn from_string_array( array: &StringArray, compressor: Arc<Compressor>, ) -> Self
Create a LiquidByteArray from an Arrow StringArray.
Sourcepub fn from_byte_array<T: ByteArrayType>(
array: &GenericByteArray<T>,
compressor: Arc<Compressor>,
) -> Self
pub fn from_byte_array<T: ByteArrayType>( array: &GenericByteArray<T>, compressor: Arc<Compressor>, ) -> Self
Create a LiquidByteArray from an Arrow ByteArray.
Sourcepub fn train_from_string_view(
array: &StringViewArray,
) -> (Arc<Compressor>, Self)
pub fn train_from_string_view( array: &StringViewArray, ) -> (Arc<Compressor>, Self)
Train a compressor from an Arrow StringViewArray.
Sourcepub fn train_from_binary_view(
array: &BinaryViewArray,
) -> (Arc<Compressor>, Self)
pub fn train_from_binary_view( array: &BinaryViewArray, ) -> (Arc<Compressor>, Self)
Train a compressor from an Arrow BinaryViewArray.
Sourcepub fn train_from_arrow<T: ByteArrayType>(
array: &GenericByteArray<T>,
) -> (Arc<Compressor>, Self)
pub fn train_from_arrow<T: ByteArrayType>( array: &GenericByteArray<T>, ) -> (Arc<Compressor>, Self)
Train a compressor from an Arrow ByteArray.
Sourcepub fn train_from_arrow_dict(
array: &DictionaryArray<UInt16Type>,
) -> (Arc<Compressor>, Self)
pub fn train_from_arrow_dict( array: &DictionaryArray<UInt16Type>, ) -> (Arc<Compressor>, Self)
Train a compressor from an Arrow DictionaryArray.
Sourcepub unsafe fn from_unique_dict_array(
array: &DictionaryArray<UInt16Type>,
compressor: Arc<Compressor>,
) -> Self
pub unsafe fn from_unique_dict_array( array: &DictionaryArray<UInt16Type>, compressor: Arc<Compressor>, ) -> Self
Only used when the dictionary is read from a trusted parquet reader, which reads a trusted parquet file, written by a trusted writer.
§Safety
The caller must ensure that the values in the dictionary are unique.
Sourcepub fn from_dict_array(
array: &DictionaryArray<UInt16Type>,
compressor: Arc<Compressor>,
) -> Self
pub fn from_dict_array( array: &DictionaryArray<UInt16Type>, compressor: Arc<Compressor>, ) -> Self
Create a LiquidByteArray from an Arrow DictionaryArray.
Sourcepub fn decompressor(&self) -> Decompressor<'_>
pub fn decompressor(&self) -> Decompressor<'_>
Get the decompressor of the LiquidStringArray.
Sourcepub fn to_dict_arrow(&self) -> DictionaryArray<UInt16Type>
pub fn to_dict_arrow(&self) -> DictionaryArray<UInt16Type>
Convert the LiquidStringArray to arrow’s DictionaryArray.
Sourcepub fn to_dict_arrow_with_selection(
&self,
selection: &BooleanArray,
) -> DictionaryArray<UInt16Type>
pub fn to_dict_arrow_with_selection( &self, selection: &BooleanArray, ) -> DictionaryArray<UInt16Type>
Convert the LiquidStringArray to a DictionaryArray with a selection.
Sourcepub fn to_arrow_array(&self) -> ArrayRef
pub fn to_arrow_array(&self) -> ArrayRef
Convert the LiquidStringArray to a StringArray.
Sourcepub fn compare_not_equals(&self, needle: &str) -> BooleanArray
pub fn compare_not_equals(&self, needle: &str) -> BooleanArray
Compare the values of the LiquidStringArray with a given string and return a BooleanArray of the result.
Sourcepub fn nulls(&self) -> Option<&NullBuffer>
pub fn nulls(&self) -> Option<&NullBuffer>
Get the nulls of the LiquidStringArray.
Sourcepub fn compare_equals(&self, needle: &str) -> BooleanArray
pub fn compare_equals(&self, needle: &str) -> BooleanArray
Compare the values of the LiquidStringArray with a given string. Leverage the distinct values to speed up the comparison. TODO: We can further optimize this by vectorizing the comparison.
Trait Implementations§
Source§impl Clone for LiquidByteArray
impl Clone for LiquidByteArray
Source§fn clone(&self) -> LiquidByteArray
fn clone(&self) -> LiquidByteArray
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LiquidByteArray
impl Debug for LiquidByteArray
Source§impl LiquidArray for LiquidByteArray
impl LiquidArray for LiquidByteArray
Source§fn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Source§fn to_arrow_array(&self) -> ArrayRef
fn to_arrow_array(&self) -> ArrayRef
Source§fn to_best_arrow_array(&self) -> ArrayRef
fn to_best_arrow_array(&self) -> ArrayRef
Source§fn try_eval_predicate(
&self,
expr: &Arc<dyn PhysicalExpr>,
filter: &BooleanBuffer,
) -> Option<BooleanArray>
fn try_eval_predicate( &self, expr: &Arc<dyn PhysicalExpr>, filter: &BooleanBuffer, ) -> Option<BooleanArray>
None if the predicate is not supported. Read moreSource§fn original_arrow_data_type(&self) -> DataType
fn original_arrow_data_type(&self) -> DataType
Source§fn data_type(&self) -> LiquidDataType
fn data_type(&self) -> LiquidDataType
Source§fn filter(&self, selection: &BooleanBuffer) -> ArrayRef
fn filter(&self, selection: &BooleanBuffer) -> ArrayRef
Source§fn squeeze(
&self,
_io: Arc<dyn SqueezeIoHandler>,
_expression_hint: Option<&CacheExpression>,
) -> Option<(LiquidSqueezedArrayRef, Bytes)>
fn squeeze( &self, _io: Arc<dyn SqueezeIoHandler>, _expression_hint: Option<&CacheExpression>, ) -> Option<(LiquidSqueezedArrayRef, Bytes)>
LiquidHybridArrayRef and a bytes::Bytes.
Return None if the Liquid array cannot be squeezed. Read moreAuto Trait Implementations§
impl Freeze for LiquidByteArray
impl RefUnwindSafe for LiquidByteArray
impl Send for LiquidByteArray
impl Sync for LiquidByteArray
impl Unpin for LiquidByteArray
impl UnsafeUnpin for LiquidByteArray
impl UnwindSafe for LiquidByteArray
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request