pub struct LiquidLinearArray<T: LiquidPrimitiveType>{ /* private fields */ }Expand description
A linear-model based integer array, only use it when you know the array is monotonic and you don’t care about encoding speed!.
Under the hood, it uses a linear model to predict the values and store the residuals: value[i] = intercept + round(slope * i) + residual[i]
Where intercept and slope are computed using a L-infinity linear fit, this is time-consuming!.
This array is only recommended if you know the array follows a linear model, e.g., kinetic values, offsets, etc.
Examples of not recommended use cases: random values like ids, categorical values, etc.
Implementations§
Source§impl<T> LiquidLinearArray<T>
impl<T> LiquidLinearArray<T>
Sourcepub fn from_arrow_array(arrow_array: PrimitiveArray<T>) -> Self
pub fn from_arrow_array(arrow_array: PrimitiveArray<T>) -> Self
Build from an Arrow PrimitiveArray<T> by training a linear model
using a fast L-infinity fit (Option 3) and storing residuals.
Sourcepub fn from_bytes(bytes: Bytes) -> Self
pub fn from_bytes(bytes: Bytes) -> Self
Decode a LiquidLinearArray<T> from bytes.
Trait Implementations§
Source§impl<T: Debug + LiquidPrimitiveType> Debug for LiquidLinearArray<T>
impl<T: Debug + LiquidPrimitiveType> Debug for LiquidLinearArray<T>
Source§impl<T> LiquidArray for LiquidLinearArray<T>
impl<T> LiquidArray for LiquidLinearArray<T>
Source§fn original_arrow_data_type(&self) -> DataType
fn original_arrow_data_type(&self) -> DataType
Get the original arrow data type of the Liquid array.
Source§fn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Get the memory size of the Liquid array.
Source§fn to_arrow_array(&self) -> ArrayRef
fn to_arrow_array(&self) -> ArrayRef
Convert the Liquid array to an Arrow array.
Source§fn filter(&self, selection: &BooleanBuffer) -> ArrayRef
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>
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. Read moreSource§fn data_type(&self) -> LiquidDataType
fn data_type(&self) -> LiquidDataType
Get the logical data type of the Liquid array.
Source§fn 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.
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)>
Squeeze the Liquid array to a
LiquidHybridArrayRef and a bytes::Bytes.
Return None if the Liquid array cannot be squeezed. Read moreAuto Trait Implementations§
impl<T> Freeze for LiquidLinearArray<T>
impl<T> RefUnwindSafe for LiquidLinearArray<T>
impl<T> Send for LiquidLinearArray<T>
impl<T> Sync for LiquidLinearArray<T>
impl<T> Unpin for LiquidLinearArray<T>
impl<T> UnsafeUnpin for LiquidLinearArray<T>
impl<T> UnwindSafe for LiquidLinearArray<T>
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
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request