All Products
Document Center

Resource management

Last Updated: Apr 11, 2018

If resource files such as .jar are required for your codes or functions, you can first upload the resource to the workspace of that project before referencing it in the periodic task or function.


Upload resources

1 Upload resources: You can upload jar/file/archive type resources, and the uploaded resources are synchronized to MaxCompute.


Parameter descriptions:

  • Name: Enter the name of the resource to be uploaded.
  • Type: Select the type (jar, file, or archive) of the resource to be uploaded.
  • Upload: Select the file to be uploaded.
  • Description: Enter the description of the resource.
  • Upload as ODPS resource: Select or unselect this checkbox as per your needs.

The limitations of uploading resources are as follows.

  • Uploading resources in batch is not supported.

  • Files more than 10 MB cannot be uploaded. Use MaxCompute client to manage these files. For more information, see Resource.

For more information on MaxCompute resources, see Basic concepts — Resources.

Reference resources in functions

If the system built-in functions cannot satisfy your needs, you can create user-defined functions by using DataWorks to implement custom processing logic. Upload the JAR package used to implement logic to the workspace, then you can reference the resource when creating user-defined functions. For more information, see Create a user-defined function.

Reference resources in codes

In periodic tasks and script files, the resources uploaded to the workspace can also be referenced in the calculation.

  1. Double-click to open the task or script that you must enter the code text, such as ODPS_SQL or SHELL.

  2. Right-click the resource file that must be used.

  3. Select Reference to insert the reference statement with the keyword resource_reference from the code editor. Now, you can use this resource by using the resource name.

Delete a resource

To delete a resource, right-click the resource in the Resource tab and click Delete.


After you delete the resource, the functions or codes that reference that resource reports an error at run time. So proceed with caution. If any change occurs, you must try to notify the persons in charge of other objects depending on the deleted resource.

Other features

On the Resource Management page, the following management operations can also be performed.

1Search: Enter the keyword to search.

1 Create directories: Enter a directory name to create a directory under the Resource Management.

1 Refresh: Refresh the current Resource Management directory.