fn expression(&self, input: &PlanNode, exprs: &[Expression], desc: &str) -> Result<PlanNode> {
        let mut dedup_exprs = vec![];
        for expr in exprs {
            let rebased_expr = unwrap_alias_exprs(expr)
                .and_then(|e| rebase_expr_from_input(&e, &input.schema()))?;
            let rebased_expr = sort_to_inner_expr(&rebased_expr);

            if !dedup_exprs.contains(&rebased_expr) {
                dedup_exprs.push(rebased_expr);
            }
        }

        // if all expression is column expression expression, we skip this expression
        if dedup_exprs.iter().all(|expr| {
            if let Expression::Column(_) = expr {
                return true;
            }
            false
        }) {
            return Ok(input.clone());
        }

        if dedup_exprs.is_empty() {
            return Ok(input.clone());
        }

        PlanBuilder::from(input)
            .expression(&dedup_exprs, desc)
            .and_then(|builder| builder.build())
    }
/// Apply a expression against exprs.
Apply a expression against exprs.
Apply a expression against exprs .
fn expression(&self, input: &PlanNode, exprs: &[Expression], desc: &str) -> Result<PlanNode> {
        let mut dedup_exprs = vec![];
        for expr in exprs {
            let rebased_expr = unwrap_alias_exprs(expr)
                .and_then(|e| rebase_expr_from_input(&e, &input.schema()))?;
            let rebased_expr = sort_to_inner_expr(&rebased_expr);
            if !dedup_exprs.contains(&rebased_expr) {
                dedup_exprs.push(rebased_expr);
            }
        }
        // if all expression is column expression expression, we skip this expression
        if dedup_exprs.iter().all(|expr| {
            if let Expression::Column(_) = expr {
                return true;
            }
            false
        }) {
            return Ok(input.clone());
        }
        if dedup_exprs.is_empty() {
            return Ok(input.clone());
        }
        PlanBuilder::from(input)
            .expression(&dedup_exprs, desc)
            .and_then(|builder| builder.build())
    }
fn expression ( & self , input : & PlanNode , exprs : & [ Expression ] , desc : & str ) -> Result < PlanNode > { let mut dedup_exprs = vec ! [ ] ; for expr in exprs { let rebased_expr = unwrap_alias_exprs ( expr ) . and_then ( | e | rebase_expr_from_input ( & e , & input . schema ( ) ) ) ? ; let rebased_expr = sort_to_inner_expr ( & rebased_expr ) ; if ! dedup_exprs . contains ( & rebased_expr ) { dedup_exprs . push ( rebased_expr ) ; } } // if all expression is column expression expression, we skip this expression if dedup_exprs . iter ( ) . all ( | expr | { if let Expression :: Column ( _ ) = expr { return true ; } false } ) { return Ok ( input . clone ( ) ) ; } if dedup_exprs . is_empty ( ) { return Ok ( input . clone ( ) ) ; } PlanBuilder :: from ( input ) . expression ( & dedup_exprs , desc ) . and_then ( | builder | builder . build ( ) ) }
Apply a expression against exprs.
Apply a expression against exprs .
&self
input
&PlanNode
exprs
&[Expression]
desc
&str
&self
input
&PlanNode
exprs
&[Expression]
desc
&str