Trait ExprPlanner

Source
pub trait ExprPlanner:
    Debug
    + Send
    + Sync {
Show 14 methods // Provided methods fn plan_binary_op( &self, expr: RawBinaryExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawBinaryExpr>, DataFusionError> { ... } fn plan_field_access( &self, expr: RawFieldAccessExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawFieldAccessExpr>, DataFusionError> { ... } fn plan_array_literal( &self, exprs: Vec<Expr>, _schema: &DFSchema, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_position( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_dictionary_literal( &self, expr: RawDictionaryExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawDictionaryExpr>, DataFusionError> { ... } fn plan_extract( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_substring( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_struct_literal( &self, args: Vec<Expr>, _is_named_struct: bool, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_overlay( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_make_map( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_compound_identifier( &self, _field: &Field, _qualifier: Option<&TableReference>, _nested_names: &[String], ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError> { ... } fn plan_any( &self, expr: RawBinaryExpr, ) -> Result<PlannerResult<RawBinaryExpr>, DataFusionError> { ... } fn plan_aggregate( &self, expr: RawAggregateExpr, ) -> Result<PlannerResult<RawAggregateExpr>, DataFusionError> { ... } fn plan_window( &self, expr: RawWindowExpr, ) -> Result<PlannerResult<RawWindowExpr>, DataFusionError> { ... }
}
Expand description

Customize planning of SQL AST expressions to Exprs

Provided Methods§

Source

fn plan_binary_op( &self, expr: RawBinaryExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawBinaryExpr>, DataFusionError>

Plan the binary operation between two expressions, returns original BinaryExpr if not possible

Source

fn plan_field_access( &self, expr: RawFieldAccessExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawFieldAccessExpr>, DataFusionError>

Plan the field access expression, such as foo.bar

returns original RawFieldAccessExpr if not possible

Source

fn plan_array_literal( &self, exprs: Vec<Expr>, _schema: &DFSchema, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plan an array literal, such as [1, 2, 3]

Returns original expression arguments if not possible

Source

fn plan_position( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plan a POSITION expression, such as POSITION(<expr> in <expr>)

Returns original expression arguments if not possible

Source

fn plan_dictionary_literal( &self, expr: RawDictionaryExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawDictionaryExpr>, DataFusionError>

Plan a dictionary literal, such as { key: value, ...}

Returns original expression arguments if not possible

Source

fn plan_extract( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plan an extract expression, such asEXTRACT(month FROM foo)

Returns original expression arguments if not possible

Source

fn plan_substring( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plan an substring expression, such as SUBSTRING(<expr> [FROM <expr>] [FOR <expr>])

Returns original expression arguments if not possible

Source

fn plan_struct_literal( &self, args: Vec<Expr>, _is_named_struct: bool, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plans a struct literal, such as {'field1' : expr1, 'field2' : expr2, ...}

This function takes a vector of expressions and a boolean flag indicating whether the struct uses the optional name

Returns the original input expressions if planning is not possible.

Source

fn plan_overlay( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plans an overlay expression, such as overlay(str PLACING substr FROM pos [FOR count])

Returns original expression arguments if not possible

Source

fn plan_make_map( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plans a make_map expression, such as make_map(key1, value1, key2, value2, ...)

Returns original expression arguments if not possible

Source

fn plan_compound_identifier( &self, _field: &Field, _qualifier: Option<&TableReference>, _nested_names: &[String], ) -> Result<PlannerResult<Vec<Expr>>, DataFusionError>

Plans compound identifier such as db.schema.table for non-empty nested names

§Note:

Currently compound identifier for outer query schema is not supported.

Returns original expression if not possible

Source

fn plan_any( &self, expr: RawBinaryExpr, ) -> Result<PlannerResult<RawBinaryExpr>, DataFusionError>

Plans ANY expression, such as expr = ANY(array_expr)

Returns origin binary expression if not possible

Source

fn plan_aggregate( &self, expr: RawAggregateExpr, ) -> Result<PlannerResult<RawAggregateExpr>, DataFusionError>

Plans aggregate functions, such as COUNT(<expr>)

Returns original expression arguments if not possible

Source

fn plan_window( &self, expr: RawWindowExpr, ) -> Result<PlannerResult<RawWindowExpr>, DataFusionError>

Plans window functions, such as COUNT(<expr>)

Returns original expression arguments if not possible

Implementations on Foreign Types§

Source§

impl ExprPlanner for AggregateFunctionPlanner

Source§

impl ExprPlanner for FieldAccessPlanner

Source§

impl ExprPlanner for NestedFunctionPlanner

Source§

impl ExprPlanner for WindowFunctionPlanner

Source§

impl ExprPlanner for CoreFunctionPlanner

Source§

impl ExprPlanner for UserDefinedFunctionPlanner

Implementors§