This documentation is for an unreleased version of Apache Flink. We recommend you use the latest stable version.
User-Defined Functions
User-Defined Functions #
Flink SQL supports user-defined functions (UDFs) to extend the built-in functionality. You can create custom scalar functions, table functions, and aggregate functions to use in your SQL queries.
Registering UDFs in SQL #
Once you have developed a UDF, you can register it in SQL using the CREATE FUNCTION statement:
CREATE FUNCTION myudf AS 'com.example.MyScalarFunction';
See the CREATE FUNCTION documentation for the full syntax.
Developing UDFs #
Writing user-defined functions requires Java, Scala, or Python programming. For detailed information on how to develop UDFs, see the Table API documentation:
- User-Defined Functions Overview: How to implement and register scalar, table, and aggregate functions.
- Process Table Functions: Advanced table functions for complex event processing.