Registers all enabled packages with a [`FunctionRegistry`], overriding any existing functions if there is a name clash.
(registry: &mut dyn FunctionRegistry)
| 216 | /// Registers all enabled packages with a [`FunctionRegistry`], overriding any existing |
| 217 | /// functions if there is a name clash. |
| 218 | pub fn register_all(registry: &mut dyn FunctionRegistry) -> Result<()> { |
| 219 | let scalar_functions: Vec<Arc<ScalarUDF>> = all_default_scalar_functions(); |
| 220 | scalar_functions.into_iter().try_for_each(|udf| { |
| 221 | let existing_udf = registry.register_udf(udf)?; |
| 222 | if let Some(existing_udf) = existing_udf { |
| 223 | debug!("Overwrite existing UDF: {}", existing_udf.name()); |
| 224 | } |
| 225 | Ok(()) as Result<()> |
| 226 | })?; |
| 227 | |
| 228 | let aggregate_functions: Vec<Arc<AggregateUDF>> = all_default_aggregate_functions(); |
| 229 | aggregate_functions.into_iter().try_for_each(|udf| { |
| 230 | let existing_udaf = registry.register_udaf(udf)?; |
| 231 | if let Some(existing_udaf) = existing_udaf { |
| 232 | debug!("Overwrite existing UDAF: {}", existing_udaf.name()); |
| 233 | } |
| 234 | Ok(()) as Result<()> |
| 235 | })?; |
| 236 | |
| 237 | let window_functions: Vec<Arc<WindowUDF>> = all_default_window_functions(); |
| 238 | window_functions.into_iter().try_for_each(|udf| { |
| 239 | let existing_udwf = registry.register_udwf(udf)?; |
| 240 | if let Some(existing_udwf) = existing_udwf { |
| 241 | debug!("Overwrite existing UDWF: {}", existing_udwf.name()); |
| 242 | } |
| 243 | Ok(()) as Result<()> |
| 244 | })?; |
| 245 | |
| 246 | Ok(()) |
| 247 | } |
searching dependent graphs…