Extending Arroyo with user-defined functions
TEXT
BYTEA
in SQL), UDFs use the reference type
(&str
and &[u8]
) for arguments and the owned types (String
and Vec<u8>
)
for return values.
Arroyo UDFs are annotated with the #[udf]
in the arroyo_udf_plugin crate.
Here’s an example of a simple UDF that squares an integer:
#[udf]
for Rust or @udf
for Python. You may include helper
functions, structs, and other definitions so long as only one function has the
udf annotation.
As you’re developing, you may make use of the “Check” button to validate the UDF
definition. Any Rust compilation or Python parsing errors will be included in
the errors box at the bottom of the UI.
process
scheduler, this will be in the
controller logs. For the kubernetes
scheduler, this will be within the actual worker pods.