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§
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.
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(&self, selection: &BooleanBuffer) -> ArrayRef
fn filter(&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,
_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)>
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.