All Products
Search
Document Center

MaxCompute:Upload a Python program and create a MaxCompute UDF

Last Updated:Mar 26, 2026

Deploy a Python program to MaxCompute by uploading it as a resource and registering it as a user-defined function (UDF) in a single step using MaxCompute Studio. This is the recommended method for performing these operations.

Prerequisites

Before you begin, ensure that you have:

Deploy and register

MaxCompute Studio combines the upload and registration steps into a single dialog, so your Python program becomes a callable UDF in one operation.

  1. In the left-side navigation pane of IntelliJ IDEA, click Project, right-click the Python program in the scripts folder, and then select Deploy to server....

  2. In the Submit resource and register function dialog box, configure the following parameters.

    Submit resource and register function

    ParameterDescription
    MaxCompute ProjectThe MaxCompute project to deploy to. Automatically populated — no selection required.
    Resource fileThe local path where the resource file is stored after upload.
    Resource nameThe name used to identify the resource in your MaxCompute project.
    Resource commentAn optional description of the resource.
    Extra resourcesAdditional resource files the UDF depends on. To select multiple files, hold Ctrl and click each file in the resource list.
    Main classThe UDF class to register, in the format <script_name>.<ClassName> — for example, my_udf.MyUDF.
    Function nameThe name used to call the UDF in SQL statements.
    Force update if already existsOverwrites the existing UDF or resource if a name conflict exists.
  3. Click OK.

After you complete the preceding operations, you can call the MaxCompute UDF in SQL statements.

What's next

  • To create or manage UDFs separately without using MaxCompute Studio, see Create a function.