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

Method create_physical_expr

datafusion/core/src/execution/context/mod.rs:804–810  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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> {

Callers 14

evaluate_demoFunction · 0.45
range_analysis_demoFunction · 0.45
type_coercion_demoFunction · 0.45
filters_to_predicateMethod · 0.45
scanMethod · 0.45
scanMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 1

readMethod · 0.80

Tested by 6

runMethod · 0.36
runMethod · 0.36
evaluate_expr_testFunction · 0.36
create_expr_testFunction · 0.36