Trait datafusion_expr::planner::ContextProvider
source · pub trait ContextProvider {
Show 13 methods
// Required methods
fn get_table_source(
&self,
name: TableReference,
) -> Result<Arc<dyn TableSource>>;
fn get_function_meta(&self, name: &str) -> Option<Arc<ScalarUDF>>;
fn get_aggregate_meta(&self, name: &str) -> Option<Arc<AggregateUDF>>;
fn get_window_meta(&self, name: &str) -> Option<Arc<WindowUDF>>;
fn get_variable_type(&self, variable_names: &[String]) -> Option<DataType>;
fn options(&self) -> &ConfigOptions;
fn udf_names(&self) -> Vec<String>;
fn udaf_names(&self) -> Vec<String>;
fn udwf_names(&self) -> Vec<String>;
// Provided methods
fn get_file_type(&self, _ext: &str) -> Result<Arc<dyn FileType>> { ... }
fn get_table_function_source(
&self,
_name: &str,
_args: Vec<Expr>,
) -> Result<Arc<dyn TableSource>> { ... }
fn create_cte_work_table(
&self,
_name: &str,
_schema: SchemaRef,
) -> Result<Arc<dyn TableSource>> { ... }
fn get_expr_planners(&self) -> &[Arc<dyn ExprPlanner>] { ... }
}
Expand description
Provides the SQL
query planner meta-data about tables and
functions referenced in SQL statements, without a direct dependency on other
DataFusion structures
Required Methods§
sourcefn get_table_source(&self, name: TableReference) -> Result<Arc<dyn TableSource>>
fn get_table_source(&self, name: TableReference) -> Result<Arc<dyn TableSource>>
Getter for a datasource
sourcefn get_aggregate_meta(&self, name: &str) -> Option<Arc<AggregateUDF>>
fn get_aggregate_meta(&self, name: &str) -> Option<Arc<AggregateUDF>>
Getter for a UDAF description
sourcefn get_variable_type(&self, variable_names: &[String]) -> Option<DataType>
fn get_variable_type(&self, variable_names: &[String]) -> Option<DataType>
Getter for system/user-defined variable type
sourcefn options(&self) -> &ConfigOptions
fn options(&self) -> &ConfigOptions
Get configuration options
sourcefn udaf_names(&self) -> Vec<String>
fn udaf_names(&self) -> Vec<String>
Get all user defined aggregate function names
sourcefn udwf_names(&self) -> Vec<String>
fn udwf_names(&self) -> Vec<String>
Get all user defined window function names
Provided Methods§
fn get_file_type(&self, _ext: &str) -> Result<Arc<dyn FileType>>
sourcefn get_table_function_source(
&self,
_name: &str,
_args: Vec<Expr>,
) -> Result<Arc<dyn TableSource>>
fn get_table_function_source( &self, _name: &str, _args: Vec<Expr>, ) -> Result<Arc<dyn TableSource>>
Getter for a table function
sourcefn create_cte_work_table(
&self,
_name: &str,
_schema: SchemaRef,
) -> Result<Arc<dyn TableSource>>
fn create_cte_work_table( &self, _name: &str, _schema: SchemaRef, ) -> Result<Arc<dyn TableSource>>
This provides a worktable (an intermediate table that is used to store the results of a CTE during execution)
We don’t directly implement this in the logical plan’s [’SqlToRel] because the sql code needs access to a table that contains execution-related types that can't be a direct dependency of the sql crate (namely, the
CteWorktable). The [
ContextProvider`] provides a way to “hide” this dependency.
sourcefn get_expr_planners(&self) -> &[Arc<dyn ExprPlanner>]
fn get_expr_planners(&self) -> &[Arc<dyn ExprPlanner>]
Getter for expr planners