pub trait DynAccumulator: 'static + Send {
// Required methods
fn accumulate(&mut self, batch: &ArrayRef) -> VortexResult<()>;
fn is_saturated(&self) -> bool;
fn flush(&mut self) -> VortexResult<Scalar>;
fn finish(&mut self) -> VortexResult<Scalar>;
}Expand description
A trait object for type-erased accumulators, used for dynamic dispatch when the aggregate function is not known at compile time.
Required Methods§
Sourcefn accumulate(&mut self, batch: &ArrayRef) -> VortexResult<()>
fn accumulate(&mut self, batch: &ArrayRef) -> VortexResult<()>
Accumulate a new array into the accumulator’s state.
Sourcefn is_saturated(&self) -> bool
fn is_saturated(&self) -> bool
Whether the accumulator’s result is fully determined.
Sourcefn flush(&mut self) -> VortexResult<Scalar>
fn flush(&mut self) -> VortexResult<Scalar>
Flush the accumulation state and return the partial aggregate result as a scalar.
Resets the accumulator state back to the initial state.
Sourcefn finish(&mut self) -> VortexResult<Scalar>
fn finish(&mut self) -> VortexResult<Scalar>
Finish the accumulation and return the final aggregate result as a scalar.
Resets the accumulator state back to the initial state.