Project Explorer of MaxCompute Studio provides a visual editor. The visual editor helps you add the resources that are required to create user-defined functions (UDFs) in your MaxCompute project. The resources include tables, JAR files, Python scripts, and compressed packages. The editor also provides an entry point to help you obtain and remove resources. This topic describes how to use Project Explorer to add, obtain, or remove resources in a visualized manner.

Background information

Before you create a UDF in MaxCompute Studio, you must upload files on which the UDF depends to your MaxCompute project as resources. MaxCompute Studio supports the following resource operations:

Add resources

  1. In the main menu bar of the IntelliJ IDEA, choose MaxCompute > Add Resource.
  2. In the Add Resource dialog box, configure the parameters.
    • Add resources other than table resourcesAdd resources other than table resources
    • Add table resourcesAdd table resources
    Parameter Description
    MaxCompute project The name of the MaxCompute project to which you want to add resources.

    If MaxCompute Studio is connected to the MaxCompute project to which you want to add resources, you can directly select the MaxCompute project from the drop-down list. If you cannot find the MaxCompute project from the drop-down list, you can click the Add icon on the right of the drop-down list to add the MaxCompute project.

    Resource type The type of the resource that you want to add. Valid values:
    • file: file resources. Files in the .zip, .so, or .jar format are supported.
    • jar: compiled JAR file resources.
    • py: Python script resources.
    • archive: compressed package resources. Compressed packages in the .zip, .tgz, .tar.gz, .tar, or .jar format are supported.
    • table: table resources. You can add table resources to a MaxCompute project.
    Resource file The local resource file that you want to add. This parameter is required only if the Resource type parameter is set to file, jar, py, or archive.
    MaxCompute table The table that you want to add as a resource. You can select a table from the drop-down list. If the resource that you want to add is a partitioned table, MaxCompute takes only a partition as a resource and not the whole partitioned table.
    Table partition The information of the partition that you want to add as a resource. This parameter is required only if the MaxCompute table parameter is set to a partitioned table. The parameter is in the partition_col1 = partition_col_value1, partition_col2 = partition_col_value2, ... format.
    Resource name The name of the resource that you want to add.
    Resource comment The comment of the resource that you want to add.
    Force update if already exists If you select this option, the newly added resource replaces the existing resource that has the same name in the MaxCompute project.
  3. In the Add Resource dialog box, click OK.
  4. Right-click the Resources folder for the MaxCompute project and select Refresh meta to refresh resource information. Then, you can view the resource that you added in the resource list.

Obtain resource files

In the left-side navigation pane of the IntelliJ IDEA, click Project Explorer. Expand the Resources folder for your MaxCompute project, right-click the name of the resource file that you want to obtain, and then select Copy local meta path to copy the path in which the resource file is saved. Then, you can obtain the resource file from the path.

Obtain a resource file
Note Files of table resources cannot be obtained.

Remove resources

  1. In the left-side navigation pane of the IntelliJ IDEA, click Project Explorer. Expand the Resources folder for your MaxCompute project, right-click the resource that you want to remove, and then select Delete resource from server.
    Remove a resource
  2. In the Confirmation Required message, click OK to remove the resource from the MaxCompute project.
  3. Right-click the Resources folder for the MaxCompute project and select Refresh meta to refresh resource information. Then, you can no longer view the resource that you added in the resource list.