Manage resources visually

更新时间:
复制 MD 格式

The Project Explorer in MaxCompute Studio provides a visual interface for managing resources for your MaxCompute UDFs. You can add, retrieve, and delete resources such as tables, JAR files, Python scripts, and archives directly within the IDE.

Background information

To register a MaxCompute UDF, you must first upload its dependencies, such as libraries or data files, as resources to your MaxCompute project. MaxCompute Studio supports the following resource operations:

Add a resource

  1. In the IntelliJ IDEA menu bar, choose MaxCompute > Add Resource.

  2. In the Add Resource dialog box, configure the following parameters.

    • To add a file-based resource: In the Add Resource dialog box, select a MaxCompute project and set Resource type to file. Click the browse button next to Resource file to select a local file. Enter a Resource name and an optional Resource comment. To overwrite an existing resource with the same name, select Force update if already exists, and then click OK.

    • To add a table resource: In the Add Resource dialog box, select the target MaxCompute project and set Resource type to table. Select the target table from the MaxCompute table drop-down list. If required, specify the partition information in the Table partition field. Enter a Resource name and an optional Resource comment. To overwrite an existing resource with the same name, select Force update if already exists, and then click OK.

    Parameter

    Description

    MaxCompute project

    The MaxCompute project where you want to add the resource.

    If MaxCompute Studio is connected to the target project, you can select it from the drop-down list. If the project is not listed, click the 添加 icon on the right to add it.

    Resource type

    The type of the resource. Valid values:

    • file: A file-type resource. Supported formats include .zip, .so, and .jar.

    • jar: A JAR file.

    • py: A Python script.

    • archive: An archive. Supported formats include .zip, .tgz, .tar.gz, .tar, and .jar.

    • table: A MaxCompute table that is used as a resource.

    Resource file

    The local resource file to add. This parameter is required only when Resource type is set to file, jar, py, or archive.

    MaxCompute table

    The table to use as a resource. You can select the target table from the drop-down list. For a partitioned table, you can add only a specific partition as a resource, not the entire table.

    Table partition

    The partition specification. This parameter is required only if MaxCompute table specifies a partitioned table. The format is partition_col1 = partition_col_value1, partition_col2 = partition_col_value2, ....

    Resource name

    The name of the resource.

    Resource comment

    An optional comment for the resource.

    Force update if already exists

    Overwrites an existing resource that has the same name in the MaxCompute project.

  3. In the Add Resource dialog box, click OK to add the resource.

  4. Right-click Resources under the target MaxCompute project and select Refresh meta. The new resource appears in the list.

Retrieve a resource file

In the Project Explorer, navigate to the Resources folder under your target MaxCompute project. Right-click the resource that you want to retrieve and select Copy local meta path. This copies the local path of the resource file.

Note

You cannot retrieve files for table resources.

Delete a resource

  1. In Project Explorer, expand the Resources folder under the target MaxCompute project. Right-click the resource that you want to delete and select Delete resource from server.

  2. In the Confirmation Required dialog box, click OK.

  3. Right-click Resources under the target MaxCompute project and select Refresh meta. The resource is removed from the list.