MCPcopy Create free account
hub / github.com/apache/datafusion / register_all

Function register_all

datafusion/spark/src/lib.rs:218–247  ·  view source on GitHub ↗

Registers all enabled packages with a [`FunctionRegistry`], overriding any existing functions if there is a name clash.

(registry: &mut dyn FunctionRegistry)

Source from the content-addressed store, hash-verified

216/// Registers all enabled packages with a [`FunctionRegistry`], overriding any existing
217/// functions if there is a name clash.
218pub 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}

Callers 4

create_contextFunction · 0.50

Calls 7

into_iterMethod · 0.45
register_udfMethod · 0.45
register_udafMethod · 0.45
register_udwfMethod · 0.45

Tested by 1

create_contextFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…