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>;
}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§
Sourcefn context_provider(&self) -> &dyn ContextProvider
fn context_provider(&self) -> &dyn ContextProvider
Provides access to the underlying context provider for reading session configuration, accessing tables, functions, and other metadata.
Sourcefn plan(&mut self, relation: TableFactor) -> Result<LogicalPlan>
fn plan(&mut self, relation: TableFactor) -> Result<LogicalPlan>
Plans the specified relation through the full planner pipeline, starting from the first registered relation planner.
Sourcefn sql_to_expr(&mut self, expr: SQLExpr, schema: &DFSchema) -> Result<Expr>
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.
Sourcefn sql_expr_to_logical_expr(
&mut self,
expr: SQLExpr,
schema: &DFSchema,
) -> Result<Expr>
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.
Sourcefn normalize_ident(&self, ident: Ident) -> String
fn normalize_ident(&self, ident: Ident) -> String
Normalizes an identifier according to session settings.
Sourcefn object_name_to_table_reference(
&self,
name: ObjectName,
) -> Result<TableReference>
fn object_name_to_table_reference( &self, name: ObjectName, ) -> Result<TableReference>
Normalizes a SQL object name into a TableReference.