Resources refer to various auxiliary files or programs that need to be used to complete data processing tasks. In most cases, resources are used to run jobs such as MapReduce jobs or jobs that use user-defined function (UDFs). The resource management feature of MaxCompute allows you to upload, register, and manage resources.
Concept
Resource is a concept specific to MaxCompute. If you want to run tasks by using MaxCompute UDFs or MapReduce, you must upload files as MaxCompute resources.
SQL UDF: After you write a UDF, you must compress the code of the UDF into a JAR package and upload the package to MaxCompute as a resource. When you execute the UDF, MaxCompute automatically downloads the JAR package and obtains the code in the package to execute the UDF. JAR files are a type of MaxCompute resource. When you upload a JAR file, a resource is created in MaxCompute.
MapReduce: After you write a MapReduce program, you must compress the program into a JAR package and upload the package to MaxCompute as a resource. When you run a MapReduce job, MapReduce automatically downloads the JAR package and obtains the code in the package to run the MapReduce job.
You can upload text files and MaxCompute tables to MaxCompute as resources. Then, you can access or use the resources when you execute UDFs or run MapReduce jobs. MaxCompute provides APIs that you can call to access and use resources. For more information, see Resource samples and Java UDFs.
Resource types
You can upload an object whose size is no more than 2,048 MB to MaxCompute as a resource. MaxCompute supports the following types of resources:
File: files in the .zip, .so, or .jar format.
Table: tables in MaxCompute.
NoteOnly BIGINT, DOUBLE, STRING, DATETIME, and BOOLEAN fields are supported in tables that are referenced by MapReduce.
JAR: compiled JAR packages.
Archive: compressed files that are identified by the resource name extension. The following file types are supported: .zip, .tgz, .tar.gz, .tar, and .jar.
Python: the Python code that you write. You can use Python code to register Python UDFs.
References
For more information about resource-related operations, see Resource operations or Manage MaxCompute resources.
If you want to use MaxCompute resource files in your code or functions, you must create or upload the resource files to the destination workspace before you reference the resource files For more information, see Create and use MaxCompute resources.