Register the UDF
MaxCompute supports UDFs. For more information, see UDF overview.
DataWorks provides the visual GUI to register functions for replacing the MaxCompute command line add function.
Currently, the Python and Java APIs supports the implementation of UDF. To compile a UDF program, you can upload the UDF code by Adding resources and then register the UDF.
UDF registration procedure
- Click Manual Business Flow in the left-side navigation pane, select Create Business Flow.
- In the offline Java environment, you can edit the program, and compress the program into a JAR package. Then create a JAR resource, submit and publish the program.
You can also create a Python resource. You can compile and save the Python code, and submit the code, and then publish the code. For more information, see Create Resources.
- Select Submit.
- Edit the function configuration.
- Class Name: The name of the main class that implements the UDF. When the resource is Python, the typical writing style is: Python resource name.Class name ('.py' is not required in the resource name).
- Resources: The name of the resource in the second step. If there are multiple resources, separate them with commas (,).
- Description: The UDF description. It is optional.
- Submit the job.
After the configuration is completed, click Save in the upper-left corner of the page or press Ctrl+S to submit (and unlock) the node to the development environment.
- Publish a node task
For more information about publishing a node task, see Publish a task.