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

Method unproject_expr

datafusion/physical-expr/src/projection.rs:492–503  ·  view source on GitHub ↗

"unproject" an expression by applying this projection in reverse, returning a new set of expressions that reference the original input columns. For example, consider an expression `c1_c2 > 5`, and a schema `[c1, c2]` a projection `c1 + c2 as c1_c2` This method would rewrite the expression to `c1 + c2 > 5`

(
        &self,
        expr: &Arc<dyn PhysicalExpr>,
    )

Source from the content-addressed store, hash-verified

490 ///
491 /// This method would rewrite the expression to `c1 + c2 > 5`
492 pub fn unproject_expr(
493 &self,
494 expr: &Arc<dyn PhysicalExpr>,
495 ) -> Result<Arc<dyn PhysicalExpr>> {
496 update_expr(expr, &self.exprs, true)?.ok_or_else(|| {
497 internal_datafusion_err!(
498 "Failed to unproject an expression {} with ProjectionExprs {}",
499 expr,
500 self.exprs.iter().map(|e| format!("{e}")).join(", ")
501 )
502 })
503 }
504
505 /// "project" an expression using these projection's expressions
506 ///

Callers 2

try_mergeMethod · 0.80
try_pushdown_filtersMethod · 0.80

Calls 1

update_exprFunction · 0.85

Tested by

no test coverage detected