"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>,
)
| 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 | /// |
no test coverage detected