Struct datafusion_physical_expr_common::aggregate::groups_accumulator::prim_op::PrimitiveGroupsAccumulator
source · pub struct PrimitiveGroupsAccumulator<T, F>{ /* private fields */ }
Expand description
An accumulator that implements a single operation over
ArrowPrimitiveType
where the accumulated state is the same as
the input type (such as Sum
)
F: The function to apply to two elements. The first argument is
the existing value and should be updated with the second value
(e.g. BitAndAssign
style).
Implementations§
source§impl<T, F> PrimitiveGroupsAccumulator<T, F>
impl<T, F> PrimitiveGroupsAccumulator<T, F>
Trait Implementations§
source§impl<T, F> Debug for PrimitiveGroupsAccumulator<T, F>
impl<T, F> Debug for PrimitiveGroupsAccumulator<T, F>
source§impl<T, F> GroupsAccumulator for PrimitiveGroupsAccumulator<T, F>
impl<T, F> GroupsAccumulator for PrimitiveGroupsAccumulator<T, F>
source§fn convert_to_state(
&self,
values: &[ArrayRef],
opt_filter: Option<&BooleanArray>,
) -> Result<Vec<ArrayRef>>
fn convert_to_state( &self, values: &[ArrayRef], opt_filter: Option<&BooleanArray>, ) -> Result<Vec<ArrayRef>>
Converts an input batch directly to a state batch
The state is:
- self.prim_fn for all non null, non filtered values
- null otherwise
source§fn update_batch(
&mut self,
values: &[ArrayRef],
group_indices: &[usize],
opt_filter: Option<&BooleanArray>,
total_num_groups: usize,
) -> Result<()>
fn update_batch( &mut self, values: &[ArrayRef], group_indices: &[usize], opt_filter: Option<&BooleanArray>, total_num_groups: usize, ) -> Result<()>
source§fn evaluate(&mut self, emit_to: EmitTo) -> Result<ArrayRef>
fn evaluate(&mut self, emit_to: EmitTo) -> Result<ArrayRef>
Returns the final aggregate value for each group as a single
RecordBatch
, resetting the internal state. Read moresource§fn state(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>>
fn state(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>>
Returns the intermediate aggregate state for this accumulator,
used for multi-phase grouping, resetting its internal state. Read more
source§fn merge_batch(
&mut self,
values: &[ArrayRef],
group_indices: &[usize],
opt_filter: Option<&BooleanArray>,
total_num_groups: usize,
) -> Result<()>
fn merge_batch( &mut self, values: &[ArrayRef], group_indices: &[usize], opt_filter: Option<&BooleanArray>, total_num_groups: usize, ) -> Result<()>
Merges intermediate state (the output from
Self::state
)
into this accumulator’s current state. Read moresource§fn supports_convert_to_state(&self) -> bool
fn supports_convert_to_state(&self) -> bool
Returns
true
if Self::convert_to_state
is implemented to support
intermediate aggregate state conversion.Auto Trait Implementations§
impl<T, F> Freeze for PrimitiveGroupsAccumulator<T, F>
impl<T, F> RefUnwindSafe for PrimitiveGroupsAccumulator<T, F>
impl<T, F> Send for PrimitiveGroupsAccumulator<T, F>
impl<T, F> Sync for PrimitiveGroupsAccumulator<T, F>
impl<T, F> Unpin for PrimitiveGroupsAccumulator<T, F>
impl<T, F> UnwindSafe for PrimitiveGroupsAccumulator<T, F>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more