Skip to content

core-udf

What it is. core-udf holds one interface, SparkUdf. It is the agreement between the engine and every function plugin: give me a name, and a way to register yourself with Spark. It contains no function of its own.

Who needs it. Plugin authors need it to write a plugin. The engine needs it to find them. Someone who only wants to use a plugin gets it automatically as a dependency.

SparkUdf.java
public interface SparkUdf {
String getName(); // the name used in Spark SQL
void register(SparkSession spark); // adds the function to a session
}

A plugin is valid when:

  • it is a public class with a public no-argument constructor;
  • it is listed in META-INF/services/com.camelioflux.plugins.udf.coreudf.SparkUdf (the tool Google AutoService can write this file for you);
  • its name is not used by another plugin. Spark SQL ignores case, so add and ADD collide.

The engine loads every implementation with Java’s ServiceLoader and registers each one:

for (SparkUdf udf : ServiceLoader.load(SparkUdf.class)) {
udf.register(spark);
}
<dependency>
<groupId>com.camelioflux.plugins.udf</groupId>
<artifactId>core-udf</artifactId>
<version>1.0.0</version>
</dependency>
VersionReleasedJavadocLinks
1.0.0latest2026-12-05This siteMaven Central · Source
0.0.1-test1test2026-12-05javadoc.ioMaven Central · Source

Open the Javadoc for 1.0.0

Versions marked test were used to check the release process and should not be used.