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

Method project_expr

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

"project" an expression using these projection's expressions 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

510 ///
511 /// * This method would rewrite the expression to `c1_c2 > 5`
512 pub fn project_expr(
513 &self,
514 expr: &Arc<dyn PhysicalExpr>,
515 ) -> Result<Arc<dyn PhysicalExpr>> {
516 update_expr(expr, &self.exprs, false)?.ok_or_else(|| {
517 internal_datafusion_err!(
518 "Failed to project an expression {} with ProjectionExprs {}",
519 expr,
520 self.exprs.iter().map(|e| format!("{e}")).join(", ")
521 )
522 })
523 }
524
525 /// Create a new [`Projector`] from this projection and an input schema.
526 ///

Callers

nothing calls this directly

Calls 1

update_exprFunction · 0.85

Tested by

no test coverage detected