AggregateFunction

Trait AggregateFunction 

Source
pub trait AggregateFunction: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn create_state(&self) -> Box<dyn AggregateState>;

    // Provided methods
    fn supports_distinct(&self) -> bool { ... }
    fn set_parameters(
        &self,
        _params: &[DataValue],
    ) -> Result<Box<dyn AggregateFunction>> { ... }
}
Expand description

Aggregate function trait Each aggregate function (SUM, COUNT, AVG, etc.) implements this

Required Methods§

Source

fn name(&self) -> &str

Function name (e.g., “SUM”, “COUNT”, “STRING_AGG”)

Source

fn description(&self) -> &str

Description for help system

Source

fn create_state(&self) -> Box<dyn AggregateState>

Create initial state for this aggregate

Provided Methods§

Source

fn supports_distinct(&self) -> bool

Does this aggregate support DISTINCT?

Source

fn set_parameters( &self, _params: &[DataValue], ) -> Result<Box<dyn AggregateFunction>>

For aggregates with parameters (like STRING_AGG separator)

Implementors§