Create a [`PhysicalExpr`] from an [`Expr`] after applying type coercion and function rewrites. Note: The expression is not [simplified] or otherwise optimized: `a = 1 + 2` will not be simplified to `a = 3` as this is a more involved process. See the [expr_api] example for how to simplify expressions. # Example ``` # use std::sync::Arc; # use arrow::datatypes::{DataType, Field, Schema}; # use dat
(
&self,
expr: Expr,
df_schema: &DFSchema,
)
| 802 | /// [simplified]: datafusion_optimizer::simplify_expressions |
| 803 | /// [expr_api]: https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/query_planning/expr_api.rs |
| 804 | pub fn create_physical_expr( |
| 805 | &self, |
| 806 | expr: Expr, |
| 807 | df_schema: &DFSchema, |
| 808 | ) -> Result<Arc<dyn PhysicalExpr>> { |
| 809 | self.state.read().create_physical_expr(expr, df_schema) |
| 810 | } |
| 811 | |
| 812 | // return an empty dataframe |
| 813 | fn return_empty_dataframe(&self) -> Result<DataFrame> { |