MCPcopy Create free account
hub / github.com/apache/datafusion / expr_as_column_expr

Function expr_as_column_expr

datafusion/expr/src/utils.rs:823–833  ·  view source on GitHub ↗

Convert any `Expr` to an `Expr::Column`.

(expr: &Expr, plan: &LogicalPlan)

Source from the content-addressed store, hash-verified

821
822/// Convert any `Expr` to an `Expr::Column`.
823pub fn expr_as_column_expr(expr: &Expr, plan: &LogicalPlan) -> Result<Expr> {
824 match expr {
825 Expr::Column(col) => {
826 let (qualifier, field) = plan.schema().qualified_field_from_column(col)?;
827 Ok(Expr::from(Column::from((qualifier, field))))
828 }
829 _ => Ok(Expr::Column(Column::from_name(
830 expr.schema_name().to_string(),
831 ))),
832 }
833}
834
835/// Recursively walk an expression tree, collecting the column indexes
836/// referenced in the expression

Callers 2

rebase_exprFunction · 0.85
aggregateMethod · 0.85

Calls 5

ColumnClass · 0.50
schemaMethod · 0.45
to_stringMethod · 0.45
schema_nameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…