// unpack alias(col) to name of the root column
unpack alias(col) to name of the root column
unpack alias ( col ) to name of the root column
pub(crate) fn expr_to_root_column(expr: &Expr) -> Result<Arc<String>> {
    match expr {
        Expr::Column(name) => Ok(name.clone()),
        Expr::Alias(expr, _) => expr_to_root_column(expr),
        Expr::Not(expr) => expr_to_root_column(expr),
        Expr::IsNull(expr) => expr_to_root_column(expr),
        Expr::IsNotNull(expr) => expr_to_root_column(expr),
        Expr::BinaryExpr { left, right, .. } => match expr_to_root_column(left) {
            Err(_) => expr_to_root_column(right),
            Ok(name) => match expr_to_root_column(right) {
                Ok(_) => Err(PolarsError::Other(
                    format!(
                        "cannot find root column for binary expression {:?}, {:?}",
                        left, right
                    )
                    .into(),
                )),
                Err(_) => Ok(name),
            },
        },
        Expr::Sort { expr, .. } => expr_to_root_column(expr),
        a => Err(PolarsError::Other(
            format!("No root column name could be found for {:?}", a).into(),
        )),
    }
}
pub ( crate ) fn expr_to_root_column ( expr : & Expr ) -> Result < Arc < String > > { match expr { Expr :: Column ( name ) => Ok ( name . clone ( ) ) , Expr :: Alias ( expr , _ ) => expr_to_root_column ( expr ) , Expr :: Not ( expr ) => expr_to_root_column ( expr ) , Expr :: IsNull ( expr ) => expr_to_root_column ( expr ) , Expr :: IsNotNull ( expr ) => expr_to_root_column ( expr ) , Expr :: BinaryExpr { left , right , .. } => match expr_to_root_column ( left ) { Err ( _ ) => expr_to_root_column ( right ) , Ok ( name ) => match expr_to_root_column ( right ) { Ok ( _ ) => Err ( PolarsError :: Other ( format ! ( " " left right ) . into ( ) , ) ) , Err ( _ ) => Ok ( name ) , } , } , Expr :: Sort { expr , .. } => expr_to_root_column ( expr ) , a => Err ( PolarsError :: Other ( format ! ( " " a ) . into ( ) , ) ) , } }
unpack alias(col) to name of the root column
unpack alias ( col ) to name of the root column
expr
&Expr