fn has_wildcard(expr: &Expr) -> bool {
    match expr {
        Expr::Duplicated(expr) => has_wildcard(expr),
        Expr::Unique(expr) => has_wildcard(expr),
        Expr::Wildcard => true,
        Expr::Column(_) => false,
        Expr::Reverse(expr) => has_wildcard(expr),
        Expr::Alias(expr, _) => has_wildcard(expr),
        Expr::Not(expr) => has_wildcard(expr),
        Expr::IsNull(expr) => has_wildcard(expr),
        Expr::IsNotNull(expr) => has_wildcard(expr),
        Expr::BinaryExpr { left, right, .. } => has_wildcard(left) | has_wildcard(right),
        Expr::Sort { expr, .. } => has_wildcard(expr),
        Expr::AggFirst(expr) => has_wildcard(expr),
        Expr::AggLast(expr) => has_wildcard(expr),
        Expr::AggGroups(expr) => has_wildcard(expr),
        Expr::AggNUnique(expr) => has_wildcard(expr),
        Expr::AggQuantile { expr, .. } => has_wildcard(expr),
        Expr::AggSum(expr) => has_wildcard(expr),
        Expr::AggMin(expr) => has_wildcard(expr),
        Expr::AggMax(expr) => has_wildcard(expr),
        Expr::AggMedian(expr) => has_wildcard(expr),
        Expr::AggMean(expr) => has_wildcard(expr),
        Expr::AggCount(expr) => has_wildcard(expr),
        Expr::Cast { expr, .. } => has_wildcard(expr),
        Expr::Apply { input, .. } => has_wildcard(input),
        Expr::Literal(_) => false,
        Expr::AggList(expr) => has_wildcard(expr),
        Expr::Ternary {
            predicate,
            truthy,
            falsy,
        } => has_wildcard(predicate) | has_wildcard(truthy) | has_wildcard(falsy),
        Expr::Shift { input, .. } => has_wildcard(input),
    }
}
/// Check if Expression has a wildcard somewhere in the tree.
Check if Expression has a wildcard somewhere in the tree.
Check if Expression has a wildcard somewhere in the tree .
fn has_wildcard(expr: &Expr) -> bool {
    match expr {
        Expr::Duplicated(expr) => has_wildcard(expr),
        Expr::Unique(expr) => has_wildcard(expr),
        Expr::Wildcard => true,
        Expr::Column(_) => false,
        Expr::Reverse(expr) => has_wildcard(expr),
        Expr::Alias(expr, _) => has_wildcard(expr),
        Expr::Not(expr) => has_wildcard(expr),
        Expr::IsNull(expr) => has_wildcard(expr),
        Expr::IsNotNull(expr) => has_wildcard(expr),
        Expr::BinaryExpr { left, right, .. } => has_wildcard(left) | has_wildcard(right),
        Expr::Sort { expr, .. } => has_wildcard(expr),
        Expr::AggFirst(expr) => has_wildcard(expr),
        Expr::AggLast(expr) => has_wildcard(expr),
        Expr::AggGroups(expr) => has_wildcard(expr),
        Expr::AggNUnique(expr) => has_wildcard(expr),
        Expr::AggQuantile { expr, .. } => has_wildcard(expr),
        Expr::AggSum(expr) => has_wildcard(expr),
        Expr::AggMin(expr) => has_wildcard(expr),
        Expr::AggMax(expr) => has_wildcard(expr),
        Expr::AggMedian(expr) => has_wildcard(expr),
        Expr::AggMean(expr) => has_wildcard(expr),
        Expr::AggCount(expr) => has_wildcard(expr),
        Expr::Cast { expr, .. } => has_wildcard(expr),
        Expr::Apply { input, .. } => has_wildcard(input),
        Expr::Literal(_) => false,
        Expr::AggList(expr) => has_wildcard(expr),
        Expr::Ternary {
            predicate,
            truthy,
            falsy,
        } => has_wildcard(predicate) | has_wildcard(truthy) | has_wildcard(falsy),
        Expr::Shift { input, .. } => has_wildcard(input),
    }
}
fn has_wildcard ( expr : & Expr ) -> bool { match expr { Expr :: Duplicated ( expr ) => has_wildcard ( expr ) , Expr :: Unique ( expr ) => has_wildcard ( expr ) , Expr :: Wildcard => true , Expr :: Column ( _ ) => false , Expr :: Reverse ( expr ) => has_wildcard ( expr ) , Expr :: Alias ( expr , _ ) => has_wildcard ( expr ) , Expr :: Not ( expr ) => has_wildcard ( expr ) , Expr :: IsNull ( expr ) => has_wildcard ( expr ) , Expr :: IsNotNull ( expr ) => has_wildcard ( expr ) , Expr :: BinaryExpr { left , right , .. } => has_wildcard ( left ) | has_wildcard ( right ) , Expr :: Sort { expr , .. } => has_wildcard ( expr ) , Expr :: AggFirst ( expr ) => has_wildcard ( expr ) , Expr :: AggLast ( expr ) => has_wildcard ( expr ) , Expr :: AggGroups ( expr ) => has_wildcard ( expr ) , Expr :: AggNUnique ( expr ) => has_wildcard ( expr ) , Expr :: AggQuantile { expr , .. } => has_wildcard ( expr ) , Expr :: AggSum ( expr ) => has_wildcard ( expr ) , Expr :: AggMin ( expr ) => has_wildcard ( expr ) , Expr :: AggMax ( expr ) => has_wildcard ( expr ) , Expr :: AggMedian ( expr ) => has_wildcard ( expr ) , Expr :: AggMean ( expr ) => has_wildcard ( expr ) , Expr :: AggCount ( expr ) => has_wildcard ( expr ) , Expr :: Cast { expr , .. } => has_wildcard ( expr ) , Expr :: Apply { input , .. } => has_wildcard ( input ) , Expr :: Literal ( _ ) => false , Expr :: AggList ( expr ) => has_wildcard ( expr ) , Expr :: Ternary { predicate , truthy , falsy , } => has_wildcard ( predicate ) | has_wildcard ( truthy ) | has_wildcard ( falsy ) , Expr :: Shift { input , .. } => has_wildcard ( input ) , } }
Check if Expression has a wildcard somewhere in the tree.
Check if Expression has a wildcard somewhere in the tree .
expr
&Expr
expr
&Expr