This topic describes the concept of resource and the types of resources in MaxCompute. Resources are used when you perform some specific operations.

Concept

Resource is a concept specific to MaxCompute. To accomplish tasks by using user-defined functions (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.
Note Some limits are imposed on how MaxCompute UDFs and MapReduce access resources. For more information, see Limits.

Resource types

You can upload an object whose size is no more than 500 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.
    Note Only 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.

For more information about resource-related operations, see Resource operations or MaxCompute resources.