Skip to main content

StatBinder

Trait StatBinder 

Source
pub trait StatBinder {
    // Required methods
    fn scope(&self) -> &DType;
    fn bind_aggregate(
        &self,
        input: &Expression,
        aggregate_fn: &AggregateFnRef,
        stat_dtype: &DType,
    ) -> VortexResult<Option<Expression>>;

    // Provided method
    fn missing_stat(&self, dtype: DType) -> VortexResult<Expression> { ... }
}
Expand description

A target that can bind abstract statistics to concrete expressions.

Implementations define how a pruning proof should read stats from a specific backing representation. For example, a zone-map binder can translate a max(col) placeholder into a field reference in the per-zone stats table, while a file-stats binder can translate the same placeholder into a literal value from the file footer.

Required Methods§

Source

fn scope(&self) -> &DType

The dtype scope used to type-check expressions before stats are bound.

Source

fn bind_aggregate( &self, input: &Expression, aggregate_fn: &AggregateFnRef, stat_dtype: &DType, ) -> VortexResult<Option<Expression>>

Bind aggregate_fn(input) to a concrete expression.

Implementations should return Ok(None) when the requested aggregate statistic is unavailable in their backing representation.

Provided Methods§

Source

fn missing_stat(&self, dtype: DType) -> VortexResult<Expression>

Expression to use when a stat is unavailable.

The default is a nullable null literal, which preserves three-valued pruning semantics for stats-table execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§