pub trait PluginAccumulator: Send {
// Required methods
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<(), FnError>;
fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<(), FnError>;
fn state(&self) -> Result<Vec<ScalarValue>, FnError>;
fn evaluate(&self) -> Result<ScalarValue, FnError>;
fn size(&self) -> usize;
}Expand description
Per-group state machine for an aggregate function.
One PluginAccumulator instance is created per group. The host calls
update_batch repeatedly with the group’s rows, then evaluate for the
final value. For distributed aggregation, the host calls state on
partial accumulators and merge_batch on the final accumulator.
Required Methods§
Sourcefn evaluate(&self) -> Result<ScalarValue, FnError>
fn evaluate(&self) -> Result<ScalarValue, FnError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".