Skip to main content

DynAccumulator

Trait DynAccumulator 

Source
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§

Source

fn accumulate(&mut self, batch: &ArrayRef) -> VortexResult<()>

Accumulate a new array into the accumulator’s state.

Source

fn is_saturated(&self) -> bool

Whether the accumulator’s result is fully determined.

Source

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.

Source

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.

Implementors§