This article shows how to use the common commands to operate functions in the MaxCompute client.
You can also operate functions through the visualized online data development tools in DataWorks.
Create a function
CREATE FUNCTION AS USING ;
- function_name: UDF name, which is the name referenced in SQL.
- package_to_class：For Java UDF, this name is a fully qualified class name (from top-level package name to UDF class name). This parameter must be in double quotation marks.
- resource_list: resources list used by UDF.
- The resource which contains UDF code must be included in the list.
- If the your code reads the resource file by distributed cache interface, this list also contains the list of resource files read by the UDF.
- The resource list is composed of multiple resource names, separated by comma (,). The resource list must be in double quotation marks.
CREATE FUNCTION test_lower AS 'org.alidata.odps.udf.examples.Lower' USING 'my_lower.jar';
Delete a function
DROP FUNCTION ;
DROP FUNCTION test_lower;
list functions; --View all user-defined functions in current project. list functions -p my_project; --View all user-defined functions in the project 'my_project'.