MaxCompute provides many built-in functions to meet the computing requests of the users. A User Defined Function (UDF) is similar to any other Built-in Function. Users can create user-defined functions according to their computing requirements.
<dependency> <groupId>com.aliyun.odps</groupId> <artifactId>odps-sdk-udf</artifactId> <version>0.20.7-public</version> </dependency>
|UDF(User Defined Scalar Function)||User Defined Scalar function. The relationship between input and output is a one-to-one relationship. Read a row data and write an output value.|
|UDTF (UserDefined Table Valued Function)||User-defined table valued functions are used in scenarios where the calling of one function leads to multiple rows of data being output. It is a unique user-defined function which can return multiple fields, while UDFcan only output a return value.|
|UDAF（User Defined Aggregation Function）||User Defined Aggregation Function (UDAF), the relationship between its input and output is one-to-many relationships. That is to aggregate multiple input records to an output value. It can be used with a Group By clause.. For more information, see Aggregation Functions.|
MaxCompute UDF supports cross-project sharing. A UDF in project_b can be used in project_a. For more information, , see Authorization in Security Guide documentation. other_project:udf_in_other_project(arg0, arg1) as res from table_t;。
Please see UDF Example in Quick Start Volume.