fn add_to_accumulated(
    predicate: &Expr,
    acc_projections: &mut Vec<Expr>,
    names: &mut HashSet<Arc<String>, RandomState>,
) -> Result<()> {
    if let Expr::Literal(_) = predicate {
        return Ok(());
    }
    match unpack_binary_exprs(predicate) {
        Ok((left, right)) => {
            add_to_accumulated(left, acc_projections, names)?;
            add_to_accumulated(right, acc_projections, names)?;
        }
        Err(_) => {
            let name = expr_to_root_column(predicate)?;
            if names.insert(name) {
                acc_projections.push(expr_to_root_column_expr(predicate)?.clone());
            }
        }
    }
    Ok(())
}
// utility function such that we can recurse all binary expressions in the expression tree
utility function such that we can recurse all binary expressions in the expression tree
utility function such that we can recurse all binary expressions in the expression tree
fn add_to_accumulated(
    predicate: &Expr,
    acc_projections: &mut Vec<Expr>,
    names: &mut HashSet<Arc<String>, RandomState>,
) -> Result<()> {
    if let Expr::Literal(_) = predicate {
        return Ok(());
    }
    match unpack_binary_exprs(predicate) {
        Ok((left, right)) => {
            add_to_accumulated(left, acc_projections, names)?;
            add_to_accumulated(right, acc_projections, names)?;
        }
        Err(_) => {
            let name = expr_to_root_column(predicate)?;
            if names.insert(name) {
                acc_projections.push(expr_to_root_column_expr(predicate)?.clone());
            }
        }
    }
    Ok(())
}
fn add_to_accumulated ( predicate : & Expr , acc_projections : & mut Vec < Expr > , names : & mut HashSet < Arc < String > , RandomState > , ) -> Result < ( ) > { if let Expr :: Literal ( _ ) = predicate { return Ok ( ( ) ) ; } match unpack_binary_exprs ( predicate ) { Ok ( ( left , right ) ) => { add_to_accumulated ( left , acc_projections , names ) ? ; add_to_accumulated ( right , acc_projections , names ) ? ; } Err ( _ ) => { let name = expr_to_root_column ( predicate ) ? ; if names . insert ( name ) { acc_projections . push ( expr_to_root_column_expr ( predicate ) ? . clone ( ) ) ; } } } Ok ( ( ) ) }
utility function such that we can recurse all binary expressions in the expression tree
utility function such that we can recurse all binary expressions in the expression tree
predicate
&Expr
acc_projections
&mut Vec<Expr>
names
&mut HashSet<Arc<String>, RandomState>
predicate
&Expr
acc_projections
&mut Vec<Expr>
names
&mut HashSet<Arc<String>, RandomState>