Managing UDFs on the Flink Web UI
You can customize functions to extend SQL statements to meet personalized requirements. These functions are called user-defined functions (UDFs). You can upload and manage UDF JAR files on the Flink web UI and call UDFs when running jobs.
Flink supports the following three types of UDFs, as described in Table 1.
Type |
Description |
---|---|
User-defined Scalar function (UDF) |
Supports one or more input parameters and returns a single result value. For details, see UDF Java and SQL Examples. |
User-defined aggregation function (UDAF) |
Aggregates multiple records into one value. For details, see UDAF Java and SQL Examples. |
User-defined table-valued function (UDTF) |
Supports one or more input parameters and returns multiple rows or columns. For details, see UDTF Java and SQL Examples. |
Prerequisites
You have prepared a UDF JAR file whose size does not exceed 200 MB.
Uploading a UDF
- Access the Flink web UI. For details, see Accessing the Flink Web UI.
- Click UDF Management. The UDF Management page is displayed.
- Click Add UDF. Select and upload the prepared UDF JAR file for Local .jar File.
- Enter the UDF name and description and click OK.
A maximum of 10 UDF names can be added. Name can be customized. Type must correspond to the UDF function in the uploaded UDF JAR file.
- In the UDF list, you can view information about all UDFs in the current application.
- (Optional) If you need to run or develop a job immediately, configure the job on the Job Management page.
Click Job Management. The job management page is displayed.
- Starting a UDF job: In the Operation column of the UDF job, click Start.
- Developing a UDF job: In the Operation column of the UDF job, click Develop. For details about related parameters, see Creating a Flink SQL job.
- Stopping a UDF job: In the Operation column of the UDF job, click Stop.
- Deleting a UDF job: In the Operation column of the UDF job, click Delete. Only jobs in the Stop state can be deleted.
- Editing a UDF job: In the Operation column of the UDF job, click Edit. Only the description of a job can be modified.
- Viewing job details: In the Operation column of the UDF job, choose More > Job Monitoring.
- Performing checkpoint failure recovery: In the Operation column of the UDF job, choose More > Checkpoint failure recovery to recover the fault. You can perform checkpoint failure recovery for jobs in the Running failed, Running Succeeded, or Stop state.
Editing a UDF
- Upload a UDF JAR file. For details, see Uploading a UDF.
- In the Operation column of the UDF job, click Edit. The Edit UDF page is displayed.
- Modify the information and click OK.
Deleting a UDF
- Upload a UDF JAR file. For details, see Uploading a UDF.
- In the Operation column of the UDF job, click Delete. The Delete UDF page is displayed.
- Confirm the information about the UDF to be deleted and click OK.
Only the UDFs that are not used can be deleted.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.