pub struct AvgAccumulator { /* private fields */ }
Expand description
An accumulator to compute the average
Implementations
Trait Implementations
sourceimpl Accumulator for AvgAccumulator
impl Accumulator for AvgAccumulator
sourcefn state(&self) -> Result<Vec<AggregateState>>
fn state(&self) -> Result<Vec<AggregateState>>
Returns the state of the accumulator at the end of the accumulation.
in the case of an average on which we track
sum
and n
, this function should return a vector
of two values, sum and n. Read moresourcefn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
Updates the accumulator’s state from a vector of arrays.
sourcefn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
updates the accumulator’s state from a vector of states.
sourcefn evaluate(&self) -> Result<ScalarValue>
fn evaluate(&self) -> Result<ScalarValue>
returns its value based on its current state.
sourcefn retract_batch(
&mut self,
_values: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
fn retract_batch(
&mut self,
_values: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
Retracts an update (caused by the given inputs) to accumulator’s state.
Inverse operation of the
update_batch
operation. This method must be
for accumulators that should support bounded OVER aggregates. Read moreAuto Trait Implementations
impl RefUnwindSafe for AvgAccumulator
impl Send for AvgAccumulator
impl Sync for AvgAccumulator
impl Unpin for AvgAccumulator
impl UnwindSafe for AvgAccumulator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more