<< All versions
Skill v1.0.1
currentLLM-judged scan90/100datasqrl/sqrl/implement-udf
+1 new
──Details
PublishedOctober 22, 2026 at 11:33 PM
Content Hashsha256:eb4d2ce1b4763235...
Git SHAda0367eaa9b4
Bump Typepatch
──Files
Files (1 file, 1.8 KB)
SKILL.md1.8 KBactive
SKILL.md · 27 lines · 1.8 KB
version: "1.0.1" name: implement-udf description: Use when SQRL/SQL alone cannot implement required logic. Use to create custom scalar, aggregate, or table functions in Java.
Implement User Defined Function
Implement New UDF
Only implement a UDF if the functionality cannot be implemented with existing Flink SQL or DataSQRL functions. Look up existing functions first.
Follow these steps:
- From the project root directory, initialize function with
/opt/agent/cmd.sh add-func <function-name>to create a scalar UDF. Append--aggregateto create an aggregate function. - New function implementation is added in the
functions/folder with the name<function-name>.java - The generated file declares
//DEPS org.apache.flink:flink-table-common:<version>with the compiler's Flink version. Keep this line: the UDF does not compile without it. - Import into SQRL script with
IMPORT functions.<function-name>orIMPORT functions.*for all functions.functions/sits at the project root, so from a script in a subfolder use the reservedrootprefix —IMPORT root.functions.<function-name>— since SQRL relative dot-paths cannot climb upward. (Inside an included project, keep the import relative so it travels with the copied files.)
Edit UDF
Follow these steps:
- Edit the
.javafile in thefunctions/folder - Try to use standard java libraries
- Use JBANG
//DEPSto include dependencies, next to the generatedflink-table-commonone compile,testandrunbuild the UDFs with JBang. A build failure stops the command with[FATAL] Failed to build JBang UDF(s) [...]followed by the javac output: fix the reported file and line before anything else- Implement tests for the function in the
mainmethod - Execute the
mainmethod after each edit to ensure function compiles and works correctly