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. TheCREATE 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
UseCREATE 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. TheCREATE 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
Embedded UDFs
Embedded UDFs
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. TheCREATE 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