fn aggregate(
        &self,
        input: &PlanNode,
        aggr_exprs: &[Expression],
        group_by_exprs: &[Expression],
    ) -> Result<PlanNode> {
        let aggr_exprs = aggr_exprs
            .iter()
            .map(|expr| rebase_expr_from_input(expr, &input.schema()))
            .collect::<Result<Vec<_>>>()?;

        let group_by_exprs = group_by_exprs
            .iter()
            .map(|expr| rebase_expr_from_input(expr, &input.schema()))
            .collect::<Result<Vec<_>>>()?;

        // S0: Apply a partial aggregator plan.
        // S1: Apply a fragment plan for distributed planners split.
        // S2: Apply a final aggregator plan.
        PlanBuilder::from(input)
            .aggregate_partial(&aggr_exprs, &group_by_exprs)
            .and_then(|builder| {
                builder.aggregate_final(input.schema(), &aggr_exprs, &group_by_exprs)
            })
            .and_then(|builder| builder.build())
    }
/// Wrap a plan for an aggregate
Wrap a plan for an aggregate
Wrap a plan for an aggregate
fn aggregate(
        &self,
        input: &PlanNode,
        aggr_exprs: &[Expression],
        group_by_exprs: &[Expression],
    ) -> Result<PlanNode> {
        let aggr_exprs = aggr_exprs
            .iter()
            .map(|expr| rebase_expr_from_input(expr, &input.schema()))
            .collect::<Result<Vec<_>>>()?;
        let group_by_exprs = group_by_exprs
            .iter()
            .map(|expr| rebase_expr_from_input(expr, &input.schema()))
            .collect::<Result<Vec<_>>>()?;
        // S0: Apply a partial aggregator plan.
        // S1: Apply a fragment plan for distributed planners split.
        // S2: Apply a final aggregator plan.
        PlanBuilder::from(input)
            .aggregate_partial(&aggr_exprs, &group_by_exprs)
            .and_then(|builder| {
                builder.aggregate_final(input.schema(), &aggr_exprs, &group_by_exprs)
            })
            .and_then(|builder| builder.build())
    }
fn aggregate ( & self , input : & PlanNode , aggr_exprs : & [ Expression ] , group_by_exprs : & [ Expression ] , ) -> Result < PlanNode > { let aggr_exprs = aggr_exprs . iter ( ) . map ( | expr | rebase_expr_from_input ( expr , & input . schema ( ) ) ) . collect :: < Result < Vec < _ > > > ( ) ? ; let group_by_exprs = group_by_exprs . iter ( ) . map ( | expr | rebase_expr_from_input ( expr , & input . schema ( ) ) ) . collect :: < Result < Vec < _ > > > ( ) ? ; // S0: Apply a partial aggregator plan. // S1: Apply a fragment plan for distributed planners split. // S2: Apply a final aggregator plan. PlanBuilder :: from ( input ) . aggregate_partial ( & aggr_exprs , & group_by_exprs ) . and_then ( | builder | { builder . aggregate_final ( input . schema ( ) , & aggr_exprs , & group_by_exprs ) } ) . and_then ( | builder | builder . build ( ) ) }
Wrap a plan for an aggregate
Wrap a plan for an aggregate
&self
input
&PlanNode
aggr_exprs
&[Expression]
group_by_exprs
&[Expression]
&self
input
&PlanNode
aggr_exprs
&[Expression]
group_by_exprs
&[Expression]