Skip to main content

FunctionRegistry

Trait FunctionRegistry 

Source
pub trait FunctionRegistry {
Show 19 methods // Required methods fn udfs(&self) -> HashSet<String>; fn higher_order_function_names(&self) -> HashSet<String>; fn udafs(&self) -> HashSet<String>; fn udwfs(&self) -> HashSet<String>; fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>, DataFusionError>; fn higher_order_function( &self, name: &str, ) -> Result<Arc<HigherOrderUDF>, DataFusionError>; fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>, DataFusionError>; fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>, DataFusionError>; fn expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>; // Provided methods fn register_udf( &mut self, _udf: Arc<ScalarUDF>, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError> { ... } fn register_higher_order_function( &mut self, _function: Arc<HigherOrderUDF>, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError> { ... } fn register_udaf( &mut self, _udaf: Arc<AggregateUDF>, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError> { ... } fn register_udwf( &mut self, _udaf: Arc<WindowUDF>, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError> { ... } fn deregister_udf( &mut self, _name: &str, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError> { ... } fn deregister_higher_order_function( &mut self, _name: &str, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError> { ... } fn deregister_udaf( &mut self, _name: &str, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError> { ... } fn deregister_udwf( &mut self, _name: &str, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError> { ... } fn register_function_rewrite( &mut self, _rewrite: Arc<dyn FunctionRewrite + Sync + Send>, ) -> Result<(), DataFusionError> { ... } fn register_expr_planner( &mut self, _expr_planner: Arc<dyn ExprPlanner>, ) -> Result<(), DataFusionError> { ... }
}
Expand description

A registry knows how to build logical expressions out of user-defined function’ names

Required Methods§

Source

fn udfs(&self) -> HashSet<String>

Returns names of all available scalar user defined functions.

Source

fn higher_order_function_names(&self) -> HashSet<String>

Returns names of all available higher order user defined functions.

Source

fn udafs(&self) -> HashSet<String>

Returns names of all available aggregate user defined functions.

Source

fn udwfs(&self) -> HashSet<String>

Returns names of all available window user defined functions.

Source

fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>, DataFusionError>

Returns a reference to the user defined scalar function (udf) named name.

Source

fn higher_order_function( &self, name: &str, ) -> Result<Arc<HigherOrderUDF>, DataFusionError>

Returns a reference to the user defined higher order function named name.

Source

fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>, DataFusionError>

Returns a reference to the user defined aggregate function (udaf) named name.

Source

fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>, DataFusionError>

Returns a reference to the user defined window function (udwf) named name.

Source

fn expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>

Set of all registered ExprPlanners

Provided Methods§

Source

fn register_udf( &mut self, _udf: Arc<ScalarUDF>, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>

Registers a new ScalarUDF, returning any previously registered implementation.

Returns an error (the default) if the function can not be registered, for example if the registry is read only.

Source

fn register_higher_order_function( &mut self, _function: Arc<HigherOrderUDF>, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError>

Registers a new HigherOrderUDF, returning any previously registered implementation.

Returns an error (the default) if the function can not be registered, for example if the registry is read only.

Source

fn register_udaf( &mut self, _udaf: Arc<AggregateUDF>, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>

Registers a new AggregateUDF, returning any previously registered implementation.

Returns an error (the default) if the function can not be registered, for example if the registry is read only.

Source

fn register_udwf( &mut self, _udaf: Arc<WindowUDF>, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>

Registers a new WindowUDF, returning any previously registered implementation.

Returns an error (the default) if the function can not be registered, for example if the registry is read only.

Source

fn deregister_udf( &mut self, _name: &str, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>

Deregisters a ScalarUDF, returning the implementation that was deregistered.

Returns an error (the default) if the function can not be deregistered, for example if the registry is read only.

Source

fn deregister_higher_order_function( &mut self, _name: &str, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError>

Deregisters a HigherOrderUDF, returning the implementation that was deregistered.

Returns an error (the default) if the function can not be deregistered, for example if the registry is read only.

Source

fn deregister_udaf( &mut self, _name: &str, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>

Deregisters a AggregateUDF, returning the implementation that was deregistered.

Returns an error (the default) if the function can not be deregistered, for example if the registry is read only.

Source

fn deregister_udwf( &mut self, _name: &str, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>

Deregisters a WindowUDF, returning the implementation that was deregistered.

Returns an error (the default) if the function can not be deregistered, for example if the registry is read only.

Source

fn register_function_rewrite( &mut self, _rewrite: Arc<dyn FunctionRewrite + Sync + Send>, ) -> Result<(), DataFusionError>

Registers a new FunctionRewrite with the registry.

FunctionRewrite rules are used to rewrite certain / operators in the logical plan to function calls. For example a || b might be written to array_concat(a, b).

This allows the behavior of operators to be customized by the user.

Source

fn register_expr_planner( &mut self, _expr_planner: Arc<dyn ExprPlanner>, ) -> Result<(), DataFusionError>

Registers a new ExprPlanner with the registry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FunctionRegistry for SessionContext

Source§

impl FunctionRegistry for SessionState

Source§

fn udfs(&self) -> HashSet<String>

Source§

fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>, DataFusionError>

Source§

fn higher_order_function( &self, name: &str, ) -> Result<Arc<HigherOrderUDF>, DataFusionError>

Source§

fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>, DataFusionError>

Source§

fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>, DataFusionError>

Source§

fn register_udf( &mut self, udf: Arc<ScalarUDF>, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>

Source§

fn register_higher_order_function( &mut self, function: Arc<HigherOrderUDF>, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError>

Source§

fn register_udaf( &mut self, udaf: Arc<AggregateUDF>, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>

Source§

fn register_udwf( &mut self, udwf: Arc<WindowUDF>, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>

Source§

fn deregister_udf( &mut self, name: &str, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>

Source§

fn deregister_higher_order_function( &mut self, name: &str, ) -> Result<Option<Arc<HigherOrderUDF>>, DataFusionError>

Source§

fn deregister_udaf( &mut self, name: &str, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>

Source§

fn deregister_udwf( &mut self, name: &str, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>

Source§

fn register_function_rewrite( &mut self, rewrite: Arc<dyn FunctionRewrite + Sync + Send>, ) -> Result<(), DataFusionError>

Source§

fn expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>

Source§

fn register_expr_planner( &mut self, expr_planner: Arc<dyn ExprPlanner>, ) -> Result<(), DataFusionError>

Source§

fn higher_order_function_names(&self) -> HashSet<String>

Source§

fn udafs(&self) -> HashSet<String>

Source§

fn udwfs(&self) -> HashSet<String>

Source§

impl FunctionRegistry for TaskContext

Implementors§