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§
Sourcefn scope(&self) -> &DType
fn scope(&self) -> &DType
The dtype scope used to type-check expressions before stats are bound.
Sourcefn bind_aggregate(
&self,
input: &Expression,
aggregate_fn: &AggregateFnRef,
stat_dtype: &DType,
) -> VortexResult<Option<Expression>>
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§
Sourcefn missing_stat(&self, dtype: DType) -> VortexResult<Expression>
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".