pub trait LiquidArray:
Debug
+ Send
+ Sync {
Show 13 methods
// 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> ⓘ;
fn filter(&self, selection: &BooleanBuffer) -> LiquidArrayRef;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn to_best_arrow_array(&self) -> ArrayRef { ... }
fn filter_to_arrow(&self, selection: &BooleanBuffer) -> ArrayRef { ... }
fn try_eval_predicate(
&self,
_predicate: &Arc<dyn PhysicalExpr>,
_filter: &BooleanBuffer,
) -> Option<BooleanArray> { ... }
fn squeeze(&self) -> Option<(LiquidHybridArrayRef, Bytes)> { ... }
}Expand description
A Liquid array.
Required Methods§
Sourcefn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Get the memory size of the Liquid array.
Sourcefn to_arrow_array(&self) -> ArrayRef
fn to_arrow_array(&self) -> ArrayRef
Convert the Liquid array to an Arrow array.
Sourcefn data_type(&self) -> LiquidDataType
fn data_type(&self) -> LiquidDataType
Get the logical data type of the Liquid array.
Sourcefn original_arrow_data_type(&self) -> DataType
fn original_arrow_data_type(&self) -> DataType
Get the original arrow data type of the Liquid array.
Sourcefn filter(&self, selection: &BooleanBuffer) -> LiquidArrayRef
fn filter(&self, selection: &BooleanBuffer) -> LiquidArrayRef
Filter the Liquid array with a boolean buffer.
Provided Methods§
Sourcefn to_best_arrow_array(&self) -> ArrayRef
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.
Sourcefn filter_to_arrow(&self, selection: &BooleanBuffer) -> ArrayRef
fn filter_to_arrow(&self, selection: &BooleanBuffer) -> ArrayRef
Filter the Liquid array with a boolean array and return an arrow array.
Sourcefn try_eval_predicate(
&self,
_predicate: &Arc<dyn PhysicalExpr>,
_filter: &BooleanBuffer,
) -> Option<BooleanArray>
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.
Sourcefn squeeze(&self) -> Option<(LiquidHybridArrayRef, Bytes)>
fn squeeze(&self) -> Option<(LiquidHybridArrayRef, 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().
If we soak the LiquidHybridArrayRef back with the bytes, we should get the same LiquidArray.
Trait Implementations§
Source§impl AsLiquidArray for dyn LiquidArray + '_
impl AsLiquidArray for dyn LiquidArray + '_
Source§fn as_string_array_opt(&self) -> Option<&LiquidByteArray>
fn as_string_array_opt(&self) -> Option<&LiquidByteArray>
Source§fn as_primitive_array_opt<T: LiquidPrimitiveType>(
&self,
) -> Option<&LiquidPrimitiveArray<T>>
fn as_primitive_array_opt<T: LiquidPrimitiveType>( &self, ) -> Option<&LiquidPrimitiveArray<T>>
Source§fn as_binary_array_opt(&self) -> Option<&LiquidByteArray>
fn as_binary_array_opt(&self) -> Option<&LiquidByteArray>
Source§fn as_byte_view_array_opt(&self) -> Option<&LiquidByteViewArray<MemoryBuffer>>
fn as_byte_view_array_opt(&self) -> Option<&LiquidByteViewArray<MemoryBuffer>>
Source§fn as_float_array_opt<T: LiquidFloatType>(&self) -> Option<&LiquidFloatArray<T>>
fn as_float_array_opt<T: LiquidFloatType>(&self) -> Option<&LiquidFloatArray<T>>
Source§fn as_string(&self) -> &LiquidByteArray
fn as_string(&self) -> &LiquidByteArray
Source§fn as_binary(&self) -> &LiquidByteArray
fn as_binary(&self) -> &LiquidByteArray
Source§fn as_byte_view(&self) -> &LiquidByteViewArray<MemoryBuffer>
fn as_byte_view(&self) -> &LiquidByteViewArray<MemoryBuffer>
Source§fn as_primitive<T: LiquidPrimitiveType>(&self) -> &LiquidPrimitiveArray<T>
fn as_primitive<T: LiquidPrimitiveType>(&self) -> &LiquidPrimitiveArray<T>
Source§fn as_float<T: LiquidFloatType>(&self) -> &LiquidFloatArray<T>
fn as_float<T: LiquidFloatType>(&self) -> &LiquidFloatArray<T>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".