Skip to main content

AggregateFunction

Trait AggregateFunction 

Source
pub trait AggregateFunction: Debug {
    // Required methods
    fn next_value(&self, input_value: &Value, state: &mut Option<Value>);
    fn finalize(&self, state: Option<Value>) -> Result<Value, EvaluationError>;

    // Provided method
    fn next_distinct(
        &self,
        input_value: &Value,
        state: &mut Option<Value>,
        seen: &mut FxHashMap<Value, ()>,
    ) { ... }
}
Expand description

Represents an SQL aggregation function computed on a collection of input values.

Required Methods§

Source

fn next_value(&self, input_value: &Value, state: &mut Option<Value>)

Provides the next value for the given group.

Source

fn finalize(&self, state: Option<Value>) -> Result<Value, EvaluationError>

Returns the result of the aggregation function for a given group.

Provided Methods§

Source

fn next_distinct( &self, input_value: &Value, state: &mut Option<Value>, seen: &mut FxHashMap<Value, ()>, )

Implementors§