Currently, DataWorks allows you to develop user-defined functions (UDFs) in Python and Java. This topic describes how to register a UDF.
Register a UDF
- Log on to the DataWorks console. In the left-side navigation pane, click Workspaces. On the Workspaces page, find the target workspace and click Data Analytics in the Actions column.
- Create a workflow. For more information, see Create a workflow.
- Write Java code in the offline Java environment, compress the code to a JAR package, and upload the package as a JAR resource to DataWorks. For more information, see Resource.
- Create a UDF.
- Find the target workflow, right-click MaxCompute, and choose .
- In the Create Function dialog box that appears, enter the function name, select the target folder, and click
Note If multiple MaxCompute computing engines are bound to the current workspace, you must select one from the Engine Instance MaxCompute drop-down list.
- On the Register Function page that appears, set the parameters as required and click the icon in the toolbar.
The Class Name parameter specifies the name of the class for implementing the UDF. The Resources parameter specifies the resources of the UDF. Separate multiple resource names with commas (,).Note You can view the UDFs that you have committed or deployed on the MaxCompute Functions page. For more information, see MaxCompute functions.
- Commit the node.
After the node properties are configured, click the Save icon in the upper-left corner. Then, commit or commit and unlock the node to the development environment.
- Deploy the node.
For more information, see Deploy a node.