pub struct AggregateExpr {
pub function: AggregateFunction,
pub column: Option<usize>,
pub distinct: bool,
pub alias: Option<String>,
pub percentile: Option<f64>,
}Expand description
An aggregation expression.
Fields§
§function: AggregateFunctionThe aggregation function.
column: Option<usize>Column index to aggregate (None for COUNT(*)).
distinct: boolWhether to aggregate distinct values only.
alias: Option<String>Output alias (for naming the result column).
percentile: Option<f64>Percentile parameter for PERCENTILE_DISC/PERCENTILE_CONT (0.0 to 1.0).
Implementations§
Source§impl AggregateExpr
impl AggregateExpr
Sourcepub fn count_star() -> Self
pub fn count_star() -> Self
Creates a COUNT(*) expression.
Sourcepub fn stdev(column: usize) -> Self
pub fn stdev(column: usize) -> Self
Creates a STDEV(column) expression (sample standard deviation).
Sourcepub fn stdev_pop(column: usize) -> Self
pub fn stdev_pop(column: usize) -> Self
Creates a STDEVP(column) expression (population standard deviation).
Sourcepub fn percentile_disc(column: usize, percentile: f64) -> Self
pub fn percentile_disc(column: usize, percentile: f64) -> Self
Creates a PERCENTILE_DISC(column, percentile) expression.
§Arguments
column- Column index to aggregatepercentile- Percentile value between 0.0 and 1.0 (e.g., 0.5 for median)
Sourcepub fn percentile_cont(column: usize, percentile: f64) -> Self
pub fn percentile_cont(column: usize, percentile: f64) -> Self
Creates a PERCENTILE_CONT(column, percentile) expression.
§Arguments
column- Column index to aggregatepercentile- Percentile value between 0.0 and 1.0 (e.g., 0.5 for median)
Sourcepub fn with_distinct(self) -> Self
pub fn with_distinct(self) -> Self
Sets the distinct flag.
Sourcepub fn with_alias(self, alias: impl Into<String>) -> Self
pub fn with_alias(self, alias: impl Into<String>) -> Self
Sets the output alias.
Trait Implementations§
Source§impl Clone for AggregateExpr
impl Clone for AggregateExpr
Source§fn clone(&self) -> AggregateExpr
fn clone(&self) -> AggregateExpr
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 moreAuto Trait Implementations§
impl Freeze for AggregateExpr
impl RefUnwindSafe for AggregateExpr
impl Send for AggregateExpr
impl Sync for AggregateExpr
impl Unpin for AggregateExpr
impl UnwindSafe for AggregateExpr
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