MaxCompute Studio lets you develop, test, and publish Python user-defined functions (UDFs) without leaving your IDE.
Prerequisites
Before you begin, ensure that you have:
Develop a Python UDF
In the Project section, right-click scripts under the MaxCompute script module and choose New > MaxCompute Python.
In the Create new MaxCompute python class dialog box, enter a class name in the Name field, select python UDF from the Kind drop-down list, and then click OK.

Write the UDF code in the code editor.

Test the Python UDF
MaxCompute Studio supports local runs, which let you download sample data from a table to your local machine, run the UDF on that data, and debug the output.
Right-click the developed Python UDF and select RUN.
In the Edit configuration dialog box, configure the following parameters and click OK.

Parameter Description MaxCompute project The MaxCompute project in which the UDF runs. Defaults to the connected project. To use a different project, add it as prompted. MaxCompute table The table whose data the UDF processes. Select a table from the drop-down list. Table columns The columns in the selected table that the UDF operates on. Download Record limit The maximum number of records to download as sample data. Default: 100. To download more than 100 records, run the Tunnel command on the MaxCompute client, or use the table download feature in MaxCompute Studio. If the specified data is already downloaded, MaxCompute Studio skips the download. To re-download, run the Tunnel command on the MaxCompute client.
MaxCompute Studio fetches the sample data based on the columns you specified and runs the UDF locally on that data. Local runs use the
pyouscript provided by PyODPS (the MaxCompute SDK for Python). The local run command takes the formpyou hello.Plus<data. After installing PyODPS, verify that thepyouscript is available at the following path:OS Path Windows ${python}/../Scripts/pyoumacOS ${python}/../pyouAfter the download, view the sample data in the data file of the table under the warehouse directory.
View the output on the Console tab and debug the code if needed.

Publish the Python UDF
After testing, publish the UDF to the production environment. For more information, see Upload a Python program and create a MaxCompute UDF.