fn aggregate(
        &self,
        input: &PlanNode,
        aggr_expr: Vec<ExpressionPlan>,
        group_by: &[sqlparser::ast::Expr],
    ) -> Result<PlanNode> {
        let group_expr: Vec<ExpressionPlan> = group_by
            .iter()
            .map(|e| self.sql_to_rex(&e, &input.schema()))
            .collect::<Result<Vec<ExpressionPlan>>>()?;

        // 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_expr.clone(), group_expr.clone())?
            .stage(self.ctx.get_id()?, StageState::AggregatorMerge)?
            .aggregate_final(aggr_expr, group_expr)?
            .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_expr: Vec<ExpressionPlan>,
        group_by: &[sqlparser::ast::Expr],
    ) -> Result<PlanNode> {
        let group_expr: Vec<ExpressionPlan> = group_by
            .iter()
            .map(|e| self.sql_to_rex(&e, &input.schema()))
            .collect::<Result<Vec<ExpressionPlan>>>()?;
        // 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_expr.clone(), group_expr.clone())?
            .stage(self.ctx.get_id()?, StageState::AggregatorMerge)?
            .aggregate_final(aggr_expr, group_expr)?
            .build()
    }
fn aggregate ( & self , input : & PlanNode , aggr_expr : Vec < ExpressionPlan > , group_by : & [ sqlparser :: ast :: Expr ] , ) -> Result < PlanNode > { let group_expr : Vec < ExpressionPlan > = group_by . iter ( ) . map ( | e | self . sql_to_rex ( & e , & input . schema ( ) ) ) . collect :: < Result < Vec < ExpressionPlan > > > ( ) ? ; // 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_expr . clone ( ) , group_expr . clone ( ) ) ? . stage ( self . ctx . get_id ( ) ? , StageState :: AggregatorMerge ) ? . aggregate_final ( aggr_expr , group_expr ) ? . build ( ) }
Wrap a plan for an aggregate
Wrap a plan for an aggregate
&self
input
&PlanNode
aggr_expr
Vec<ExpressionPlan>
group_by
&[sqlparser::ast::Expr]
&self
input
&PlanNode
aggr_expr
Vec<ExpressionPlan>
group_by
&[sqlparser::ast::Expr]