Trait datafusion::physical_plan::AggregateExpr [−][src]
pub trait AggregateExpr: Send + Sync + Debug { fn as_any(&self) -> &dyn Any; 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 as_any(&self) -> &dyn Any
[src]
Returns the aggregate expression as Any
so that it can be
downcast to a specific implementation.
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.
Implementors
impl AggregateExpr for DistinctCount
[src]
impl AggregateExpr for DistinctCount
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
impl AggregateExpr for Avg
[src]
impl AggregateExpr for Avg
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
impl AggregateExpr for Count
[src]
impl AggregateExpr for Count
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
impl AggregateExpr for Max
[src]
impl AggregateExpr for Max
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
impl AggregateExpr for Min
[src]
impl AggregateExpr for Min
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
impl AggregateExpr for Sum
[src]
impl AggregateExpr for Sum
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting
fn field(&self) -> Result<Field>
[src]
fn state_fields(&self) -> Result<Vec<Field>>
[src]
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>
[src]
fn create_accumulator(&self) -> Result<Box<dyn Accumulator>>
[src]
impl AggregateExpr for AggregateFunctionExpr
[src]
impl AggregateExpr for AggregateFunctionExpr
[src]fn as_any(&self) -> &dyn Any
[src]
Return a reference to Any that can be used for downcasting