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

Function strip_column_qualifiers

datafusion/core/src/physical_planner.rs:2323–2336  ·  view source on GitHub ↗

Strip table qualifiers from column references in an expression. This is needed because DML filter expressions contain qualified column names (e.g., "table.column") but the TableProvider's schema only has simple names.

(expr: Expr)

Source from the content-addressed store, hash-verified

2321/// This is needed because DML filter expressions contain qualified column names
2322/// (e.g., "table.column") but the TableProvider's schema only has simple names.
2323fn strip_column_qualifiers(expr: Expr) -> Result<Expr> {
2324 expr.transform(|e| {
2325 if let Expr::Column(col) = &e
2326 && col.relation.is_some()
2327 {
2328 // Strip the qualifier
2329 return Ok(Transformed::yes(Expr::Column(Column::new_unqualified(
2330 col.name.clone(),
2331 ))));
2332 }
2333 Ok(Transformed::no(e))
2334 })
2335 .map(|t| t.data)
2336}
2337
2338/// Extract column assignments from an UPDATE input plan.
2339/// For UPDATE statements, the SQL planner encodes assignments as a projection

Callers 2

extract_dml_filtersFunction · 0.85

Calls 4

ColumnClass · 0.50
mapMethod · 0.45
transformMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…