Skip to main content

LiquidArray

Trait LiquidArray 

Source
pub trait LiquidArray:
    Debug
    + Send
    + Sync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn get_array_memory_size(&self) -> usize;
    fn len(&self) -> usize;
    fn to_arrow_array(&self) -> ArrayRef;
    fn data_type(&self) -> LiquidDataType;
    fn original_arrow_data_type(&self) -> DataType;
    fn to_bytes(&self) -> Vec<u8> ;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn to_best_arrow_array(&self) -> ArrayRef { ... }
    fn filter(&self, selection: &BooleanBuffer) -> ArrayRef { ... }
    fn try_eval_predicate(
        &self,
        _predicate: &Arc<dyn PhysicalExpr>,
        _filter: &BooleanBuffer,
    ) -> Option<BooleanArray> { ... }
    fn squeeze(
        &self,
        _io: Arc<dyn SqueezeIoHandler>,
        _expression_hint: Option<&CacheExpression>,
    ) -> Option<(LiquidSqueezedArrayRef, Bytes)> { ... }
}
Expand description

A Liquid array.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Get the underlying any type.

Source

fn get_array_memory_size(&self) -> usize

Get the memory size of the Liquid array.

Source

fn len(&self) -> usize

Get the length of the Liquid array.

Source

fn to_arrow_array(&self) -> ArrayRef

Convert the Liquid array to an Arrow array.

Source

fn data_type(&self) -> LiquidDataType

Get the logical data type of the Liquid array.

Source

fn original_arrow_data_type(&self) -> DataType

Get the original arrow data type of the Liquid array.

Source

fn to_bytes(&self) -> Vec<u8>

Serialize the Liquid array to a byte array.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the Liquid array is empty.

Source

fn to_best_arrow_array(&self) -> ArrayRef

Convert the Liquid array to an Arrow array. Except that it will pick the best encoding for the arrow array. Meaning that it may not obey the data type of the original arrow array.

Source

fn filter(&self, selection: &BooleanBuffer) -> ArrayRef

Filter the Liquid array with a boolean array and return an arrow array.

Source

fn try_eval_predicate( &self, _predicate: &Arc<dyn PhysicalExpr>, _filter: &BooleanBuffer, ) -> Option<BooleanArray>

Try to evaluate a predicate on the Liquid array with a filter. Returns None if the predicate is not supported.

Note that the filter is a boolean buffer, not a boolean array, i.e., filter can’t be nullable. The returned boolean mask is nullable if the the original array is nullable.

Source

fn squeeze( &self, _io: Arc<dyn SqueezeIoHandler>, _expression_hint: Option<&CacheExpression>, ) -> Option<(LiquidSqueezedArrayRef, Bytes)>

Squeeze the Liquid array to a LiquidHybridArrayRef and a bytes::Bytes. Return None if the Liquid array cannot be squeezed.

This is the bridge from in-memory array to hybrid array. Important: The returned Bytes is the data that is stored on disk, it is the same as to_bytes().

Hydrating the hybrid array from the stored bytes should yield the same LiquidArray.

Trait Implementations§

Source§

impl AsLiquidArray for dyn LiquidArray + '_

Source§

fn as_string_array_opt(&self) -> Option<&LiquidByteArray>

Get the underlying string array.
Source§

fn as_primitive_array_opt<T: LiquidPrimitiveType>( &self, ) -> Option<&LiquidPrimitiveArray<T>>

Get the underlying primitive array.
Source§

fn as_binary_array_opt(&self) -> Option<&LiquidByteArray>

Get the underlying binary array.
Source§

fn as_byte_view_array_opt(&self) -> Option<&LiquidByteViewArray<FsstArray>>

Get the underlying byte view array.
Source§

fn as_float_array_opt<T: LiquidFloatType>(&self) -> Option<&LiquidFloatArray<T>>

Get the underlying float array.
Source§

fn as_string(&self) -> &LiquidByteArray

Get the underlying string array.
Source§

fn as_binary(&self) -> &LiquidByteArray

Get the underlying binary array.
Source§

fn as_byte_view(&self) -> &LiquidByteViewArray<FsstArray>

Get the underlying byte view array.
Source§

fn as_primitive<T: LiquidPrimitiveType>(&self) -> &LiquidPrimitiveArray<T>

Get the underlying primitive array.
Source§

fn as_float<T: LiquidFloatType>(&self) -> &LiquidFloatArray<T>

Get the underlying float array.

Implementors§