If your data stored in Tablestore is uniquely structured and you want to define development
logic to process each row of data, such as parsing a specific JSON string, you can
use User Defined Function (UDF).
Procedure
- Install the MaxCompute-Java/MaxCompute-Studio plug-in in IntelliJ. For more information,
see What is Studio. After the plug-in is installed, you can start development.
The following figure shows a simple UDF definition, which connects two strings. MaxCompute
supports more complex UDF, such as user-defined window execution logic. For more information,
see Develop and debug UDF.

- Install the MaxCompute-Java/MaxCompute-Studio plug-in in IntelliJ. For more information,
see What is Studio. After the plug-in is installed, you can start development.
The following figure shows a simple UDF definition, which connects two strings. MaxCompute
supports more complex UDF, such as user-defined window execution logic. For more information,
see Develop and debug UDF.
- Upload the package to MaxCompute after the resource is packaged.
Choose . Enter the name and output directory. Then, click the + icon to select the output module. After the resource is packaged, use MaxCompute
Project Explorer to upload the resource and create a function. Then, you can call
the function in SQL.

- Run bin/odpscmd.bat.
// Select a row of data and pass in name/name to the UDF. A connection of the two strings is returned.
select cloud_metric_extract_md5(name, name) as udf_test from test_table limit 1;
A similar output is returned.