Write a plugin
-
Create a repository under
camelioflux/plugins/user-defined-function-plugins, named<thing>-udf. -
Depend on the contract and on Spark (Spark is
provided, because the cluster has it):<dependency><groupId>com.camelioflux.plugins.udf</groupId><artifactId>core-udf</artifactId><version>1.0.0</version></dependency> -
Implement
SparkUdf:@AutoService(SparkUdf.class)public final class MaxUdf implements SparkUdf {public String getName() { return "MAXOF"; }public void register(SparkSession spark) {spark.udf().register("MAXOF", (UDF1<Seq<Number>, Double>) values -> /* ... */, DataTypes.DoubleType);}} -
Test it: one plain unit test for the logic and one with a local Spark session.
-
Use the shared pipeline by adding a
.gitlab-ci.ymlthat includespipelines/maven-library.ymlfromci-templates. -
Document it by adding a page under
src/content/docs/plugins/in this site and an entry insrc/data/plugins.json.
Choose a name that no other plugin uses. Spark SQL ignores case.
