pub enum AggState {
Count(u64),
SumI {
sum: i128,
count: u64,
},
SumF {
sum: f64,
count: u64,
},
AvgI {
sum: i128,
count: u64,
},
AvgF {
sum: f64,
count: u64,
},
MinI(i64),
MaxI(i64),
MinF(f64),
MaxF(f64),
Empty,
}Expand description
A mergeable running aggregate state (Phase 8.3). Two states over disjoint
row sets merge into the state over their union, so a cached analytical
aggregate can be updated by merging in only the delta (newly inserted rows)
instead of a full recompute.
Variants§
Count(u64)
COUNT(*) or COUNT(col) over n matching rows.
SumI
Int64 SUM: running i128 sum + non-null count.
SumF
Float64 SUM: running f64 sum + non-null count.
AvgI
Int64 AVG: running i128 sum + non-null count (avg = sum/count).
AvgF
Float64 AVG: running f64 sum + non-null count.
MinI(i64)
Int64 MIN/MAX.
MaxI(i64)
MinF(f64)
Float64 MIN/MAX.
MaxF(f64)
Empty
No matching rows observed yet.
Implementations§
Source§impl AggState
impl AggState
Sourcepub fn merge(self, other: AggState) -> AggState
pub fn merge(self, other: AggState) -> AggState
Combine two states over disjoint row sets into the state over the union.
Sourcepub fn point(&self) -> Option<f64>
pub fn point(&self) -> Option<f64>
The scalar point value (f64), or None when there were no inputs.
Sourcepub fn from_native(
result: NativeAggResult,
agg: NativeAgg,
ty: Option<TypeId>,
) -> Self
pub fn from_native( result: NativeAggResult, agg: NativeAgg, ty: Option<TypeId>, ) -> Self
Convert a vectorized NativeAggResult (from the cursor path) into a
mergeable AggState, so the incremental cache can be seeded from the
fast cold path. ty is the column’s type (None for COUNT(*)).
Trait Implementations§
impl StructuralPartialEq for AggState
Auto Trait Implementations§
impl Freeze for AggState
impl RefUnwindSafe for AggState
impl Send for AggState
impl Sync for AggState
impl Unpin for AggState
impl UnsafeUnpin for AggState
impl UnwindSafe for AggState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more