This topic describes how to use the MaxCompute Studio plugin in IntelliJ IDEA to develop a Java user-defined function (UDF) that converts uppercase letters to lowercase.
Prerequisites
Before you begin, complete the following prerequisites in IntelliJ IDEA:
Procedure
Write a Java UDF.
In the Project tool window, right-click the module's source directory, , and select .

In the Create new MaxCompute java class dialog box, select UDF, enter a name in the Name field, and then press Enter. For example, name the Java class Lower.

Name is the name of the MaxCompute Java class. If you have not created a package, you can enter
packagename.classnameto automatically generate a package.In the code editor, enter the following code.
The UDF code example is as follows.package <packagename>; import com.aliyun.odps.udf.UDF; public final class Lower extends UDF { public String evaluate(String s) { if (s == null) { return null; } return s.toLowerCase(); } }
Debug the UDF to verify that it runs correctly.
In the java directory, right-click the Java file and select Run.
In the Run/Debug Configurations dialog box, configure the parameters.

MaxCompute project: The MaxCompute project where the UDF runs. For a local run, select local.
MaxCompute table: The name of the MaxCompute table used by the UDF.
Table columns: The column information of the MaxCompute table used by the UDF.
Click OK. The following figure shows the result.

Register the MaxCompute UDF.
Right-click the UDF Java file and select Deploy to server....
In the Package a jar, submit resource and register function dialog box, configure the following parameters.

MaxCompute project: The project where the UDF will be registered. You can typically keep the default value.
Resource file: The path to the dependent resource file. You can keep the default value.
Resource name: The name of the dependent resource. You can keep the default value.
Function name: The registration name for the function. This name is used to call the UDF in SQL statements. For example,
Lower_test.
Click OK to complete the UDF registration.
Call the UDF.
In the Project Explorer pane on the left, right-click the target MaxCompute project, select Open in Console, enter the SQL statement to call the UDF in the console, and press Enter to run it.

select Lower_test('ALIYUN');This result confirms that the Lower_test Java UDF is ready to use.
