Adds a JAR file as a resource to a MaxCompute project.
Limitations
External tables cannot be added as resources.
The maximum size of a single resource file is 2,048 MB. Resources referenced by a single SQL or MapReduce job cannot exceed 2,048 MB in total.
This is a CMD statement and can only be run on the MaxCompute client (odpscmd).
Syntax
add jar <local_file> [comment '<comment>'] [-f];Parameters
Resource type
jar: Required. Specifies the resource type. For more information about resource types, see Resource.
Common parameters
| Parameter | Required | Description |
|---|---|---|
local_file | Yes | Local path of the file to add. The file name becomes the resource name, which uniquely identifies the resource in the project. |
alias | No | Custom name for the resource. If not specified, the file name is used as the resource name. JAR packages and Python script files do not support this parameter. |
comment | No | Comment for the resource. |
-f | No | Overwrites an existing resource if the resource name is already taken. Without -f, the command fails when a duplicate resource name exists. |
Examples
Add a JAR file using its local path:
add jar /path/to/example.jar;Add a JAR file and overwrite an existing resource with the same name:
add jar /path/to/example.jar -f;Add a JAR file with a comment:
add jar /path/to/example.jar comment 'UDF for data parsing';Related statements
ADD ARCHIVE: Adds an archive file as a resource.
ADD FILE: Adds a file as a resource.
ADD PY: Adds Python code as a resource.
ADD TABLE: Adds a table as a resource.
ALIAS: Creates an alias for a resource.
DESC RESOURCE: Views information about a resource.
DROP RESOURCE: Deletes a resource.
GET RESOURCE: Downloads a resource.
LIST RESOURCES: Views the information about resources.