@@ -18,6 +18,7 @@ use crate::aggregate_fn::AggregateFn;
1818use crate :: aggregate_fn:: AggregateFnId ;
1919use crate :: aggregate_fn:: AggregateFnRef ;
2020use crate :: dtype:: DType ;
21+ use crate :: expr:: stats:: Stat ;
2122use crate :: scalar:: Scalar ;
2223
2324/// Defines the interface for aggregate function vtables.
@@ -102,23 +103,12 @@ pub trait AggregateFnVTable: 'static + Sized + Clone + Send + Sync {
102103 /// final result is fully determined.
103104 fn is_saturated ( & self , state : & Self :: Partial ) -> bool ;
104105
105- /// Try to derive a partial scalar from the batch's cached statistics, before any
106- /// kernel dispatch or canonicalization.
106+ /// Return the legacy [`Stat`] slot that stores this aggregate, if one exists.
107107 ///
108- /// Returns `Some(partial_scalar)` if the answer can be read directly from `batch.statistics()`,
109- /// otherwise `Ok(None)` to fall through to the rest of dispatch. The returned scalar must
110- /// have the dtype reported by `partial_dtype`.
111- ///
112- /// This is the single place stats-based shortcuts live; encoding kernels must not consult
113- /// stats themselves. Runs first so that an upstream producer who pre-populates the relevant
114- /// stat (e.g. a layout reader hydrating `Stat::UncompressedSizeInBytes` from file metadata)
115- /// can skip both kernel dispatch and decode.
116- ///
117- /// TODO: this hook may be removed once `ArrayStats` stores aggregate partials internally —
118- /// at that point stat-driven shortcuts can be resolved automatically by the dispatch layer
119- /// without each aggregate vtable opting in.
120- fn try_partial_from_stats ( & self , _batch : & ArrayRef ) -> VortexResult < Option < Scalar > > {
121- Ok ( None )
108+ /// This is a temporary bridge while some aggregate partials are still cached under the
109+ /// legacy [`Stat`] enum rather than by aggregate function identity.
110+ fn maybe_stat ( & self ) -> Option < Stat > {
111+ None
122112 }
123113
124114 /// Try to accumulate the raw array before decompression.
0 commit comments