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>> { ... } fn plan_field_access( &self, expr: RawFieldAccessExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawFieldAccessExpr>> { ... } fn plan_array_literal( &self, exprs: Vec<Expr>, _schema: &DFSchema, ) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_position(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_dictionary_literal( &self, expr: RawDictionaryExpr, _schema: &DFSchema, ) -> Result<PlannerResult<RawDictionaryExpr>> { ... } fn plan_extract(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_substring( &self, args: Vec<Expr>, ) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_struct_literal( &self, args: Vec<Expr>, _is_named_struct: bool, ) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_overlay(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_make_map(&self, args: Vec<Expr>) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_compound_identifier( &self, _field: &Field, _qualifier: Option<&TableReference>, _nested_names: &[String], ) -> Result<PlannerResult<Vec<Expr>>> { ... } fn plan_any( &self, expr: RawBinaryExpr, ) -> Result<PlannerResult<RawBinaryExpr>> { ... } fn plan_aggregate( &self, expr: RawAggregateExpr, ) -> Result<PlannerResult<RawAggregateExpr>> { ... } fn plan_window( &self, expr: RawWindowExpr, ) -> Result<PlannerResult<RawWindowExpr>> { ... }
}
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>>

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

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

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

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

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

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

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

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

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

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

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

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

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

Returns original expression arguments if not possible

Source

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

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

Returns original expression arguments if not possible

Implementors§