RelationPlannerContext

Trait RelationPlannerContext 

Source
pub trait RelationPlannerContext {
    // Required methods
    fn context_provider(&self) -> &dyn ContextProvider;
    fn plan(&mut self, relation: TableFactor) -> Result<LogicalPlan>;
    fn sql_to_expr(&mut self, expr: SQLExpr, schema: &DFSchema) -> Result<Expr>;
    fn sql_expr_to_logical_expr(
        &mut self,
        expr: SQLExpr,
        schema: &DFSchema,
    ) -> Result<Expr>;
    fn normalize_ident(&self, ident: Ident) -> String;
    fn object_name_to_table_reference(
        &self,
        name: ObjectName,
    ) -> Result<TableReference>;
}
Available on crate feature sql only.
Expand description

Provides utilities for relation planners to interact with DataFusion’s SQL planner.

This trait provides SQL planning utilities specific to relation planning, such as converting SQL expressions to logical expressions and normalizing identifiers. It uses composition to provide access to session context via ContextProvider.

Required Methods§

Source

fn context_provider(&self) -> &dyn ContextProvider

Provides access to the underlying context provider for reading session configuration, accessing tables, functions, and other metadata.

Source

fn plan(&mut self, relation: TableFactor) -> Result<LogicalPlan>

Plans the specified relation through the full planner pipeline, starting from the first registered relation planner.

Source

fn sql_to_expr(&mut self, expr: SQLExpr, schema: &DFSchema) -> Result<Expr>

Converts a SQL expression into a logical expression using the current planner context.

Source

fn sql_expr_to_logical_expr( &mut self, expr: SQLExpr, schema: &DFSchema, ) -> Result<Expr>

Converts a SQL expression into a logical expression without DataFusion rewrites.

Source

fn normalize_ident(&self, ident: Ident) -> String

Normalizes an identifier according to session settings.

Source

fn object_name_to_table_reference( &self, name: ObjectName, ) -> Result<TableReference>

Normalizes a SQL object name into a TableReference.

Implementors§