[][src]Trait datafusion::physical_plan::AggregateExpr

pub trait AggregateExpr: Send + Sync + Debug {
    fn field(&self) -> Result<Field>;
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>;
fn state_fields(&self) -> Result<Vec<Field>>;
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>; }

An aggregate expression that:

  • knows its resulting field
  • knows how to create its accumulator
  • knows its accumulator's state's field
  • knows the expressions from whose its accumulator will receive values

Required methods

fn field(&self) -> Result<Field>[src]

the field of the final result of this aggregation.

fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>[src]

the accumulator used to accumulate values from the expressions. the accumulator expects the same number of arguments as expressions and must return states with the same description as state_fields

fn state_fields(&self) -> Result<Vec<Field>>[src]

the fields that encapsulate the Accumulator's state the number of fields here equals the number of states that the accumulator contains

fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>[src]

expressions that are passed to the Accumulator. Single-column aggregations such as sum return a single value, others (e.g. cov) return many.

Loading content...

Implementors

impl AggregateExpr for DistinctCount[src]

impl AggregateExpr for Avg[src]

impl AggregateExpr for Count[src]

impl AggregateExpr for Max[src]

impl AggregateExpr for Min[src]

impl AggregateExpr for Sum[src]

impl AggregateExpr for AggregateFunctionExpr[src]

Loading content...