pub struct NumericKernels;Expand description
Centralizes the numeric kernels applied to scalar expressions so they can be tuned without touching the surrounding table scan logic.
Implementations§
Source§impl ScalarEvaluator
impl ScalarEvaluator
Sourcepub fn collect_fields<F>(
expr: &ScalarExpr<F>,
acc: &mut HashSet<F, FxBuildHasher>,
)
pub fn collect_fields<F>( expr: &ScalarExpr<F>, acc: &mut HashSet<F, FxBuildHasher>, )
Collect every field referenced by the scalar expression into acc.
pub fn prepare_numeric_arrays<F>( arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>, _row_count: usize, ) -> HashMap<F, Arc<dyn Array>, FxBuildHasher>
Sourcepub fn extract_affine<F>(expr: &ScalarExpr<F>) -> Option<AffineExpr<F>>
pub fn extract_affine<F>(expr: &ScalarExpr<F>) -> Option<AffineExpr<F>>
Attempts to represent the expression as scale * column + offset.
Returns None when the expression depends on multiple columns or is non-linear.
Sourcepub fn extract_affine_simplified<F>(
expr: &ScalarExpr<F>,
) -> Option<AffineExpr<F>>
pub fn extract_affine_simplified<F>( expr: &ScalarExpr<F>, ) -> Option<AffineExpr<F>>
Variant of extract_affine that assumes expr is already simplified.
Sourcepub fn evaluate_value<F>(
expr: &ScalarExpr<F>,
idx: usize,
arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>,
) -> Result<Arc<dyn Array>, Error>
pub fn evaluate_value<F>( expr: &ScalarExpr<F>, idx: usize, arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>, ) -> Result<Arc<dyn Array>, Error>
Evaluate a scalar expression for the row at idx using the provided numeric arrays.
Sourcepub fn evaluate_batch<F>(
expr: &ScalarExpr<F>,
len: usize,
arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>,
) -> Result<Arc<dyn Array>, Error>
pub fn evaluate_batch<F>( expr: &ScalarExpr<F>, len: usize, arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>, ) -> Result<Arc<dyn Array>, Error>
Evaluate a scalar expression for every row in the batch.
Sourcepub fn evaluate_batch_simplified<F>(
expr: &ScalarExpr<F>,
len: usize,
arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>,
) -> Result<Arc<dyn Array>, Error>
pub fn evaluate_batch_simplified<F>( expr: &ScalarExpr<F>, len: usize, arrays: &HashMap<F, Arc<dyn Array>, FxBuildHasher>, ) -> Result<Arc<dyn Array>, Error>
Evaluate a scalar expression that has already been simplified.
Sourcepub fn passthrough_column<F>(expr: &ScalarExpr<F>) -> Option<F>
pub fn passthrough_column<F>(expr: &ScalarExpr<F>) -> Option<F>
Returns the column referenced by an expression when it’s a direct or additive identity passthrough.
Sourcepub fn simplify<F>(expr: &ScalarExpr<F>) -> ScalarExpr<F>
pub fn simplify<F>(expr: &ScalarExpr<F>) -> ScalarExpr<F>
Simplify an expression by constant folding and identity removal.
pub fn evaluate_constant_literal_expr<F>( expr: &ScalarExpr<F>, ) -> Result<Option<Literal>, Error>
pub fn evaluate_constant_literal_non_numeric<F>( expr: &ScalarExpr<F>, ) -> Result<Option<Literal>, Error>
pub fn is_supported_numeric(dtype: &DataType) -> bool
Auto Trait Implementations§
impl Freeze for ScalarEvaluator
impl RefUnwindSafe for ScalarEvaluator
impl Send for ScalarEvaluator
impl Sync for ScalarEvaluator
impl Unpin for ScalarEvaluator
impl UnwindSafe for ScalarEvaluator
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> 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 more