Skip to main content
There are three ways to create UDFs in RisingWave: UDFs as external functions, embedded UDFs and SQL UDFs. CREATE FUNCTION can be used for them with different syntax.

UDFs as external functions

You can define your own functions (including table functions) by some programming languages, like Python and Java, and call these functions in RisingWave. The CREATE FUNCTION command is used to declare these UDFs. After that, you can use them in SQL queries like any built-in functions.

Syntax

Added in v2.3.0: Support IF NOT EXISTS.

Parameters

Examples

Use CREATE FUNCTION to declare an external UDF defined by Python or Java. For more details, see Use UDFs in Python or Use UDFs in Java.

Embedded UDFs

Embedded UDFs are functions that run in the language runtime embedded in RisingWave computation nodes. The CREATE FUNCTION command is used to create these UDFs. Here are some examples of embedded UDFs, along with links to specific guides on creating them with different languages.
Embedded UDFs
For more details, see Embedded Python UDFs.
Embedded UDFs
For more details, see Use UDFs in JavaScript.
Embedded UDFs
For more details, see Use UDFs in Rust.

SQL UDFs

SQL UDFs in RisingWave are designed to expand directly into expressions at the frontend, resulting in minimal performance difference compared to manually calling multiple functions. The CREATE FUNCTION command is used to define SQL UDFs. You can read our guide on SQL UDFs for more details.
Syntax of SQL UDFs
Added in v2.3.0: Support IF NOT EXISTS.

See also

SHOW FUNCTIONS

Show all user-defined functions

DROP FUNCTION

Drop a user-defined function