All Products
Search
Document Center

MaxCompute:Function

Last Updated:Jan 31, 2024

Functions are programming artifacts that are used to perform specific operations in SQL statements. Functions are classified into built-in functions and user-defined functions (UDFs).

MaxCompute provides SQL computing capabilities. You can use the built-in functions in MaxCompute SQL statements to implement some computing and counting tasks. If the built-in functions do not meet your requirements, you can use the Java or Python APIs provided by MaxCompute to develop UDFs.

  • Built-in functions: Simplify the writing of SQL queries and improve the efficiency of data processing.

  • UDFs: Improve the flexibility for MaxCompute to allow you to perform customized data computing and analysis based on specific business logic.

UDFs can be classified into three types: user-defined scalar functions (UDFs), user-defined aggregate functions (UDAFs), and user-defined table-valued functions (UDTFs).

After you develop a UDF, you must compile the UDF code to a JAR package, upload the package to MaxCompute as a resource, and then register the UDF in MaxCompute.

Note

To use a UDF in MaxCompute, you only need to specify its name and parameters in an SQL statement as you do when you use the built-in functions of MaxCompute.

References

For more information about function operations, see Create a UDF, Delete a UDF, and View the UDF list.