Struct datafusion::physical_plan::expressions::MinAccumulator
source · pub struct MinAccumulator { /* private fields */ }
Expand description
An accumulator to compute the minimum value
Implementations§
source§impl MinAccumulator
impl MinAccumulator
sourcepub fn try_new(datatype: &DataType) -> Result<MinAccumulator, DataFusionError>
pub fn try_new(datatype: &DataType) -> Result<MinAccumulator, DataFusionError>
new min accumulator
Trait Implementations§
source§impl Accumulator for MinAccumulator
impl Accumulator for MinAccumulator
source§fn state(&self) -> Result<Vec<AggregateState, Global>, DataFusionError>
fn state(&self) -> Result<Vec<AggregateState, Global>, DataFusionError>
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 moresource§fn update_batch(
&mut self,
values: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
fn update_batch(
&mut self,
values: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
Updates the accumulator’s state from a vector of arrays.
source§fn merge_batch(
&mut self,
states: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
fn merge_batch(
&mut self,
states: &[Arc<dyn Array + 'static>]
) -> Result<(), DataFusionError>
updates the accumulator’s state from a vector of states.
source§fn evaluate(&self) -> Result<ScalarValue, DataFusionError>
fn evaluate(&self) -> Result<ScalarValue, DataFusionError>
returns its value based on its current state.
source§fn size(&self) -> usize
fn size(&self) -> usize
Allocated size required for this accumulator, in bytes, including
Self
.
Allocated means that for internal containers such as Vec
, the capacity
should be used
not the len
Read moresource§fn 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 more