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: You can upload jar/file/archive type resources, and the uploaded resources are synchronized to MaxCompute.
- 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.
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.
In periodic tasks and script files, the resources uploaded to the workspace can also be referenced in the calculation.
Double-click to open the task or script that you must enter the code text, such as ODPS_SQL or SHELL.
Right-click the resource file that must be used.
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.
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.
On the Resource Management page, the following management operations can also be performed.
Search: Enter the keyword to search.
Create directories: Enter a directory name to create a directory under the Resource Management.
Refresh: Refresh the current Resource Management directory.