Struct datafusion_sql::planner::PlannerContext
source · pub struct PlannerContext { /* private fields */ }
Expand description
Struct to store the states used by the Planner. The Planner will leverage the states to resolve CTEs, Views, subqueries and PREPARE statements. The states include Common Table Expression (CTE) provided with WITH clause and Parameter Data Types provided with PREPARE statement and the query schema of the outer query plan
Implementations§
source§impl PlannerContext
impl PlannerContext
sourcepub fn with_prepare_param_data_types(
self,
prepare_param_data_types: Vec<DataType>
) -> Self
pub fn with_prepare_param_data_types( self, prepare_param_data_types: Vec<DataType> ) -> Self
Update the PlannerContext with provided prepare_param_data_types
pub fn outer_query_schema(&self) -> Option<&DFSchema>
sourcepub fn set_outer_query_schema(
&mut self,
schema: Option<DFSchema>
) -> Option<DFSchema>
pub fn set_outer_query_schema( &mut self, schema: Option<DFSchema> ) -> Option<DFSchema>
sets the outer query schema, returning the existing one, if any
sourcepub fn prepare_param_data_types(&self) -> &[DataType]
pub fn prepare_param_data_types(&self) -> &[DataType]
Return the types of parameters ($1
, $2
, etc) if known
sourcepub fn contains_cte(&self, cte_name: &str) -> bool
pub fn contains_cte(&self, cte_name: &str) -> bool
returns true if there is a Common Table Expression (CTE) / Subquery for the specified name
sourcepub fn insert_cte(&mut self, cte_name: impl Into<String>, plan: LogicalPlan)
pub fn insert_cte(&mut self, cte_name: impl Into<String>, plan: LogicalPlan)
Inserts a LogicalPlan for the Common Table Expression (CTE) / Subquery for the specified name
sourcepub fn get_cte(&self, cte_name: &str) -> Option<&LogicalPlan>
pub fn get_cte(&self, cte_name: &str) -> Option<&LogicalPlan>
Return a plan for the Common Table Expression (CTE) / Subquery for the specified name
Trait Implementations§
source§impl Clone for PlannerContext
impl Clone for PlannerContext
source§fn clone(&self) -> PlannerContext
fn clone(&self) -> PlannerContext
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more