pub enum AggState {
CountStar(i64),
Count {
non_null: i64,
distinct: Option<HashSet<DistinctKey>>,
},
Sum {
acc: SumAcc,
all_null: bool,
},
Avg {
acc: SumAcc,
n: i64,
},
Min(Option<Value>),
Max(Option<Value>),
}Expand description
Per-aggregate accumulator. One instance per (group, projection-slot) pair lives for the duration of the SELECT.
Variants§
CountStar(i64)
COUNT(*) — counts every row, including all-NULL rows.
Count
COUNT(col) — counts non-NULL values, optionally with DISTINCT.
Sum
SUM(col) — skips NULLs; all_null tracks the SQL semantic that
SUM over an all-NULL or empty set yields NULL (not 0).
Avg
AVG(col) — always returns Real (or NULL on empty / all-NULL).
Min(Option<Value>)
MIN(col) / MAX(col) — track the running winner (or None until
the first non-NULL input).
Max(Option<Value>)
Implementations§
Trait Implementations§
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
Mutably borrows from an owned value. Read more