pub struct MergeableAccumulator {
pub count: i64,
pub sum: f64,
pub min: Option<Value>,
pub max: Option<Value>,
pub first: Option<Value>,
pub sum_squared: f64,
}Expand description
Accumulator state that supports merging.
Used by aggregate operators to merge partial aggregations.
Fields§
§count: i64Count of values.
sum: f64Sum of values.
min: Option<Value>Minimum value.
max: Option<Value>Maximum value.
first: Option<Value>First value encountered.
sum_squared: f64For AVG: sum of squared values (for variance if needed).
Implementations§
Source§impl MergeableAccumulator
impl MergeableAccumulator
Sourcepub fn merge(&mut self, other: &MergeableAccumulator)
pub fn merge(&mut self, other: &MergeableAccumulator)
Merges another accumulator into this one.
Sourcepub fn finalize_count(&self) -> Value
pub fn finalize_count(&self) -> Value
Finalizes COUNT aggregate.
Sourcepub fn finalize_sum(&self) -> Value
pub fn finalize_sum(&self) -> Value
Finalizes SUM aggregate.
Sourcepub fn finalize_min(&self) -> Value
pub fn finalize_min(&self) -> Value
Finalizes MIN aggregate.
Sourcepub fn finalize_max(&self) -> Value
pub fn finalize_max(&self) -> Value
Finalizes MAX aggregate.
Sourcepub fn finalize_avg(&self) -> Value
pub fn finalize_avg(&self) -> Value
Finalizes AVG aggregate.
Sourcepub fn finalize_first(&self) -> Value
pub fn finalize_first(&self) -> Value
Finalizes FIRST aggregate.
Trait Implementations§
Source§impl Clone for MergeableAccumulator
impl Clone for MergeableAccumulator
Source§fn clone(&self) -> MergeableAccumulator
fn clone(&self) -> MergeableAccumulator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MergeableAccumulator
impl Debug for MergeableAccumulator
Auto Trait Implementations§
impl Freeze for MergeableAccumulator
impl RefUnwindSafe for MergeableAccumulator
impl Send for MergeableAccumulator
impl Sync for MergeableAccumulator
impl Unpin for MergeableAccumulator
impl UnwindSafe for MergeableAccumulator
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