Information Schema is the metadata service of MaxCompute. It extends the ANSI SQL-92 Information Schema standard with MaxCompute-specific views, giving you SQL access to project metadata and job history through a dedicated public project also named Information Schema.
All views in the Information Schema project are read-only. Query them with standard SQL — no separate API or SDK call required.
From March 1, 2024, MaxCompute no longer automatically provides project-level Information Schema for new projects. If your project was created on or after that date, use tenant-level Information Schema instead, which provides broader coverage across projects.
How it works
Information Schema exposes two categories of views:
-
Metadata views — tables, columns, partitions, user-defined functions (UDFs), resources, users, roles, privileges, and labels in your project. Data is near-real-time, with an approximate 3-hour delay.
-
Usage views — job history (TASKS_HISTORY) and data tunnel history (TUNNELS_HISTORY), each retaining data for 14 days. A real-time job snapshot view (TASKS) is also available in preview.
To query a view, prefix the view name with Information_Schema:
SELECT * FROM Information_Schema.tables;
SELECT * FROM Information_Schema.tasks_history WHERE ds='yyyymmdd' LIMIT 100;
MaxCompute-specific views (such as TASKS, TASKS_HISTORY, and TUNNELS_HISTORY) may change without notice. To prevent query breakage when fields are added, always select specific columns rather than using SELECT *.
Limitations
-
Project scope only. Information Schema provides metadata for the current project only. To analyze metadata across multiple projects, collect and integrate the data from each project separately.
-
Near-real-time delay. Metadata views have an approximate 3-hour delay. For latency-sensitive use cases, use the SDK or CLI to query object metadata directly.
-
14-day history retention. TASKS_HISTORY and TUNNELS_HISTORY retain data for 14 days. To keep history beyond 14 days, export the data to a MaxCompute table on a regular schedule.
-
New projects (March 1, 2024 and later). Project-level Information Schema is not provisioned automatically. Use tenant-level Information Schema instead.
Prerequisites
Before you begin, ensure that you have:
-
An existing MaxCompute project created before March 1, 2024
-
Project owner access, or a RAM user assigned the Super_Administrator role
Install the permission package
Run the following command in the MaxCompute client or on the SQL Query page in the DataWorks console:
install package Information_Schema.systables;
After installation, Information Schema is ready to query. Storage for metadata is free.
To list all views included in the package:
odps@myproject1> describe package Information_Schema.systables;
Grant access to other users
By default, only the project owner can query Information Schema views. Other users and roles see only data they have been explicitly granted access to. To grant access, run the following commands in the MaxCompute client:
grant <actions> on package Information_Schema.systables to user <user_name>;
grant <actions> on package Information_Schema.systables to role <role_name>;
| Parameter | Description |
|---|---|
actions |
Set to Read. |
user_name |
An Alibaba Cloud account or RAM user added to the project. Run list users; to see available accounts. |
role_name |
A role added to the project. Run list roles; to see available roles. |
Example:
grant read on package Information_Schema.systables to user RAM$Bob@aliyun.com:user01;
For more information about cross-project resource access, see Cross-project resource access based on packages.
Billing
| Billing mode | How you are charged |
|---|---|
| Pay-as-you-go | SQL queries on Information Schema views are charged based on the amount of data scanned. Views use range-clustered tables internally to minimize scan size. |
| Subscription | Queries consume compute units (CUs) from your purchased quota. |
| Storage | No storage fees apply for Information Schema data. |
Usage notes
-
Select specific columns. MaxCompute-specific views may change. Avoid
SELECT *— select only the columns you need to prevent breakage when fields are added. -
Specify field names when exporting. Avoid
INSERT INTO ... SELECT * FROM information_schema.***. If new fields are added to a view, the wildcard selection may fail. Always list field names explicitly. -
Query TASKS_HISTORY and TUNNELS_HISTORY after 6:00 AM. Query the previous day's data after 6:00 AM each day to avoid scanning the current day's incomplete partition, which reduces input data and lowers query costs.
Query examples
The following examples show common patterns for querying Information Schema.
List all tables in the current project:
SELECT table_name, table_type, is_partitioned, create_time
FROM Information_Schema.tables;
Count tables by type:
SELECT table_type, COUNT(table_name) AS table_count
FROM Information_Schema.tables
GROUP BY table_type
ORDER BY table_count DESC;
Query job history for a specific date:
SELECT task_name, task_type, status, start_time, end_time, input_bytes
FROM Information_Schema.tasks_history
WHERE ds = '20240101'
LIMIT 100;
Metadata views
The following table lists all views and their key attributes. Use this table to select the right view for your task.
| Category | View | Delay | Retention |
|---|---|---|---|
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Metadata | ~3 hours | Continuous | |
| Usage | Seconds (internal testing, no SLA) | Real-time snapshots only | |
| Usage | ~3 hours | 14 days | |
| Usage | N/A | 14 days |
TABLES
Displays table information for a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project name. |
| table_name | STRING | The table name. |
| table_type | STRING | The table type. Valid values: MANAGED_TABLE, VIRTUAL_VIEW, EXTERNAL_TABLE. |
| is_partitioned | BOOLEAN | Whether the table is partitioned. |
| owner_id | STRING | The ID of the table owner. |
| owner_name | STRING | (Optional) The Alibaba Cloud account of the table owner. |
| create_time | DATETIME | The time when the table was created. |
| last_modified_time | DATETIME | The time when the table data was last modified. |
| data_length | BIGINT | The size of table data in bytes. For partitioned tables, this value is NULL — use the PARTITIONS view for per-partition sizes. |
| table_comment | STRING | The table description. |
| life_cycle | BIGINT | (Optional) The lifecycle of the table. |
| is_archived | BOOLEAN | Reserved. |
| table_exstore_type | STRING | Reserved. |
| cluster_type | STRING | The clustering type. Valid values: HASH, RANGE. |
| number_buckets | BIGINT | (Optional) The number of buckets in the clustered table. 0 means the bucket count is determined dynamically at runtime. |
| view_original_text | STRING | The view definition for tables of type VIRTUAL_VIEW. |
PARTITIONS
Displays partition information for tables in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project name. |
| table_name | STRING | The table name. |
| partition_name | STRING | The partition name. Example: ds='20190130'. |
| create_time | DATETIME | The time when the partition was created. |
| last_modified_time | DATETIME | The time when the partition was last modified. |
| data_length | BIGINT | The partition data size in bytes. |
| is_archived | BOOLEAN | Reserved. |
| is_exstore | BOOLEAN | Reserved. |
| cluster_type | STRING | (Optional) The clustering type. Valid values: HASH, RANGE. |
| number_buckets | BIGINT | (Optional) The number of buckets. 0 means the bucket count is determined dynamically at runtime. |
COLUMNS
Displays column information for tables in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project name. |
| table_name | STRING | The table name. |
| column_name | STRING | The column name. |
| ordinal_position | BIGINT | The serial number of the column. |
| column_default | STRING | The default value of the column. |
| is_nullable | BOOLEAN | (Optional) Fixed value: YES. |
| data_type | STRING | The column data type. |
| column_comment | STRING | The column description. |
| is_partition_key | BOOLEAN | Whether the column is a partition key. |
UDFS
Displays user-defined function (UDF) information for a project.
| Field | Data type | Description |
|---|---|---|
| udf_catalog | STRING | Fixed value: odps. |
| udf_schema | STRING | The project name. |
| udf_name | STRING | The UDF name. |
| owner_id | STRING | The ID of the UDF owner. |
| owner_name | STRING | (Optional) The Alibaba Cloud account of the UDF owner. |
| create_time | DATETIME | The time when the UDF was created. |
| last_modified_time | DATETIME | The time when the UDF was last modified. |
RESOURCES
Displays resource information for a project.
| Field | Data type | Description |
|---|---|---|
| resource_catalog | STRING | Fixed value: odps. |
| resource_schema | STRING | The project name. |
| resource_name | STRING | The resource name. |
| resource_type | STRING | The resource type. Valid values: Py, Jar. |
| owner_id | STRING | The ID of the resource owner. |
| owner_name | STRING | (Optional) The Alibaba Cloud account of the resource owner. |
| create_time | DATETIME | The time when the resource was created. |
| last_modified_time | DATETIME | The time when the resource was last modified. |
| size | BIGINT | The storage space used by the resource. |
| comment | STRING | The resource description. |
| is_temp_resource | BOOLEAN | Whether the resource is a temporary resource. |
UDF_RESOURCES
Displays the dependency between UDFs and resources in a project.
| Field | Data type | Description |
|---|---|---|
| udf_catalog | STRING | Fixed value: odps. |
| udf_schema | STRING | The project name. |
| udf_name | STRING | The UDF name. |
| resource_schema | STRING | The project that the resource belongs to. |
| resource_name | STRING | The resource name. |
USERS
Displays the users in a project.
| Field | Data type | Description |
|---|---|---|
| user_catalog | STRING | The account type. Valid values: ALIYUN, RAM. |
| user_schema | STRING | The project name. |
| user_name | STRING | (Optional) The username. |
| user_id | STRING | The Alibaba Cloud user ID. |
| user_label | STRING | The security label assigned to the user. |
ROLES
Displays the roles in a project.
| Field | Data type | Description |
|---|---|---|
| role_catalog | STRING | Fixed value: odps. |
| role_schema | STRING | The project name. |
| role_name | STRING | The role name. |
| role_label | STRING | The security label assigned to the role. |
| comment | STRING | The role description. |
USER_ROLES
Displays role assignments for users in a project.
| Field | Data type | Description |
|---|---|---|
| user_role_catalog | STRING | Fixed value: odps. |
| user_role_schema | STRING | The project name. |
| role_name | STRING | The role name. |
| user_name | STRING | The username. |
| user_id | STRING | The user ID. |
PACKAGE_OBJECTS
Displays the objects shared within a package in a project.
| Field | Data type | Description |
|---|---|---|
| package_catalog | STRING | Fixed value: odps. |
| package_schema | STRING | The project name. |
| package_name | STRING | The package name. |
| object_type | STRING | The type of the shared object. |
|
object_type |
STRING |
Tunnel object type. The value is TABLE or INSTANCE. |
|
object_type |
STRING |
Tunnel object type. The value is TABLE or INSTANCE. |
| object_name | STRING | The name of the shared object. |
| column_name | STRING | The column name (for table objects). |
| allowed_privileges | VECTOR\<STRING\> | The privileges granted on the object. |
| allowed_label | STRING | The security label for the object. |
INSTALLED_PACKAGES
Displays packages installed in a project.
| Field | Data type | Description |
|---|---|---|
| installed_package_catalog | STRING | Fixed value: odps. |
| installed_package_schema | STRING | The project name. |
| package_project | STRING | The project where the package was created. |
| package_name | STRING | The package name. |
| installed_time | DATETIME | Reserved. The time when the package was installed. |
| allowed_label | STRING | The security label for the package. |
SCHEMA_PRIVILEGES
Displays schema-level privilege assignments in a project.
| Field | Data type | Description |
|---|---|---|
| user_catalog | STRING | Fixed value: odps. |
| user_schema | STRING | The project name. |
| grantee | STRING | The username. |
| user_id | STRING | The user ID. |
| grantor | STRING | The account that granted the privilege. Currently NULL. |
| privilege_type | STRING | The privilege type. |
TABLE_PRIVILEGES
Displays table-level privilege assignments in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project that the table belongs to. |
| table_name | STRING | The table name. |
| grantee | STRING | The username. |
| user_id | STRING | The user ID. |
| grantor | STRING | The account that granted the privilege. Currently NULL. |
| privilege_type | STRING | The privilege type. |
| user_schema | STRING | The project that the user belongs to. |
COLUMN_PRIVILEGES
Displays column-level privilege assignments in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project that the table belongs to. |
| table_name | STRING | The table name. |
| column_name | STRING | The column name. |
| grantee | STRING | The username. |
| user_id | STRING | The user ID. |
| grantor | STRING | (Optional) Currently NULL. |
| privilege_type | STRING | The privilege type. |
| user_schema | STRING | The project that the user belongs to. |
UDF_PRIVILEGES
Displays UDF-level privilege assignments in a project.
| Field | Data type | Description |
|---|---|---|
| udf_catalog | STRING | Fixed value: odps. |
| udf_schema | STRING | The project name. |
| udf_name | STRING | The UDF name. |
| user_schema | STRING | The project that the user belongs to. |
| grantee | STRING | The username. |
| user_id | STRING | The user ID. |
| grantor | STRING | The account that granted the privilege. Currently NULL. |
| privilege_type | STRING | The privilege type. |
RESOURCE_PRIVILEGES
Displays resource-level privilege assignments in a project.
| Field | Data type | Description |
|---|---|---|
| resource_catalog | STRING | Fixed value: odps. |
| resource_schema | STRING | The project name. |
| resource_name | STRING | The resource name. |
| user_schema | STRING | The project that the user belongs to. |
| grantee | STRING | The username. |
| user_id | STRING | The user ID. |
| grantor | STRING | The account that granted the privilege. Currently NULL. |
| privilege_type | STRING | The privilege type. |
TABLE_LABELS
Displays security labels assigned to tables in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project name. |
| table_name | STRING | The table name. |
| label_type | STRING | The label type. Fixed value: NULL. |
| label_level | STRING | The label level. |
COLUMN_LABELS
Displays security labels assigned to table columns in a project.
| Field | Data type | Description |
|---|---|---|
| table_catalog | STRING | Fixed value: odps. |
| table_schema | STRING | The project name. |
| table_name | STRING | The table name. |
| column_name | STRING | The column name. |
| label_type | STRING | The label type. Fixed value: NULL. |
| label_level | STRING | The label level. |
TABLE_LABEL_GRANTS
Displays label-based access grants for tables in a project.
| Field | Data type | Description |
|---|---|---|
| table_label_grant_catalog | STRING | Fixed value: odps. |
| table_label_grant_schema | STRING | The project that the user belongs to. |
| user | STRING | The username. |
| user_id | STRING | The user ID. |
| table_schema | STRING | The project that the table belongs to. |
| table_name | STRING | The table name. |
| grantor | STRING | The account that granted the label access. Currently NULL. |
| label_level | STRING | The label level granted. |
| expired | DATETIME | The expiration time of the grant. |
COLUMN_LABEL_GRANTS
Displays label-based access grants for table columns in a project.
| Field | Data type | Description |
|---|---|---|
| column_label_grant_catalog | STRING | Fixed value: odps. |
| column_label_grant_schema | STRING | The project that the user belongs to. |
| user | STRING | The username. |
| user_id | STRING | The user ID. |
| table_schema | STRING | The project that the table belongs to. |
| table_name | STRING | The table name. |
| column_name | STRING | The column name. |
| grantor | STRING | The account that granted the label access. Currently NULL. |
| label_level | STRING | The label level granted. |
| expired | DATETIME | The expiration time of the grant. |
TASKS
Displays real-time snapshots of running jobs. Use this view to monitor active jobs.
The TASKS view is in the internal testing process and its fields and field values may change without notice. This view has no SLA guarantee. Use this view with caution. For updates on its release status, see Service notices.
| Field | Data type | Description |
|---|---|---|
| project_name | STRING | The project name. |
| task_name | STRING | The job name. |
| task_type | STRING | The job type. Valid values: SQL, CUPID (Spark or Mars jobs), SQLCost, SQLRT (MaxCompute Query Acceleration (MCQA)), LOT (MapReduce), PS (Parameter Server of PAI), AlgoTask (Machine Learning Platform for AI (PAI)). |
| inst_id | STRING | The instance ID created for the job. |
| status | STRING | The job status at collection time. Valid values: Running, Waiting. |
| owner_id | STRING | The ID of the Alibaba Cloud account that submitted the job. |
| owner_name | STRING | The name of the Alibaba Cloud account that submitted the job. |
| start_time | DATETIME | The time when the job started. |
| priority | BIGINT | The job priority. Applies to subscription resource jobs only. |
| signature | STRING | The job signature. |
| queue_name | STRING | The compute queue name. |
| cpu_usage | BIGINT | Current CPU utilization. Calculated as: number of CPU cores × 100. |
| mem_usage | BIGINT | Current memory usage in MB. |
| gpu_usage | BIGINT | Current GPU usage. Calculated as: number of GPUs × 100. |
| total_cpu_usage | BIGINT | Accumulated CPU utilization. Calculated as: CPU cores × 100 × job duration (seconds). |
| total_mem_usage | BIGINT | Accumulated memory usage. Calculated as: memory size (MB) × job duration (seconds). |
| total_gpu_usage | BIGINT | Accumulated GPU usage. Calculated as: GPU count × 100 × job duration (seconds). |
| cpu_min_ratio | BIGINT | Ratio of job CPU usage to total CPU. Applies to subscription resource jobs only. |
| mem_min_ratio | BIGINT | Ratio of job memory usage to total memory. Applies to subscription resource jobs only. |
| gpu_min_ratio | BIGINT | Ratio of job GPU usage to total GPU. Applies to subscription resource jobs only. |
| cpu_max_ratio | BIGINT | Ratio of job CPU usage to maximum CPU. Applies to subscription resource jobs only. |
| mem_max_ratio | BIGINT | Ratio of job memory usage to maximum memory. Applies to subscription resource jobs only. |
| gpu_max_ratio | BIGINT | Ratio of job GPU usage to maximum GPU. Applies to subscription resource jobs only. |
| settings | STRING | Custom scheduling settings from upper-layer applications such as DataWorks. |
| additional_info | STRING | Reserved. |
TASKS_HISTORY
Displays job execution history for a project. Data from the last 14 days is retained.
| Field | Data type | Description |
|---|---|---|
| task_catalog | STRING | Fixed value: odps. |
| task_schema | STRING | The project name. |
| task_name | STRING | The job name. |
| task_type | STRING | The job type. Valid values: SQL, CUPID, SQLCost, SQLRT, LOT, PS, AlgoTask. |
| inst_id | STRING | The instance ID. |
| status | STRING | The job status at collection time (not real-time). Valid values: Terminated, Failed, Cancelled. |
| owner_id | STRING | The ID of the Alibaba Cloud account. |
| owner_name | STRING | The name of the Alibaba Cloud account. |
| result | STRING | Error information for failed SQL jobs. |
| start_time | DATETIME | The time when the job started. |
| end_time | DATETIME | The time when the job ended. NULL if the job did not end on the collection day. |
| input_records | BIGINT | The number of records read. |
| output_records | BIGINT | The number of records written. |
| input_bytes | BIGINT | The amount of data scanned, consistent with LogView. |
| output_bytes | BIGINT | The number of output bytes. |
| input_tables | STRING | Input tables in [project.table1, project.table2] format. Not available for all job types (for example, SQLCost jobs). |
| output_tables | STRING | Output tables in [project.table1, project.table2] format. |
| operation_text | STRING | The source XML of the query. NULL if the file exceeds 256 KB. |
| signature | STRING | (Optional) The job signature. |
| complexity | DOUBLE | (Optional) The job complexity. Available for SQL jobs only. |
| cost_cpu | DOUBLE | CPU cost. A value of 100 equals 1 CPU core × 1 second. Example: 10 cores running for 5 seconds = 5,000. |
| cost_mem | DOUBLE | Memory cost. Calculated as: memory size (MB) × job duration (seconds). |
| settings | STRING | Scheduling metadata in JSON format. Includes fields: USERAGENT, BIZID, SKYNET_ID, SKYNET_NODENAME. |
| ds | STRING | The date when data was collected. Example: 20190101. |
TUNNELS_HISTORY
Displays upload and download history for the MaxCompute Tunnel service. Data from the last 14 days is retained.
| Field | Data type | Description |
|---|---|---|
| tunnel_catalog | STRING | Fixed value: odps. |
| tunnel_schema | STRING | The project name. |
| session_id | STRING | The session ID, in the format TIMESTAMP(YYYYMMDDHHmmss, 14 chars) + IP(8 chars) + numHex(8 chars). Example: 2013060414484474e5e60a00000002. |
| operate_type | STRING | The operation type. Valid values: UPLOADLOG, DOWNLOADLOG, DOWNLOADINSTANCELOG. |
| tunnel_type | STRING | The tunnel type. Valid values: TUNNEL LOG, TUNNEL INSTANCE LOG. |
| request_id | STRING | The request ID. |
| object_type | STRING | The object type. Valid values: TABLE, INSTANCE. |
| object_name | STRING | The table name or instance ID. |
| partition_spec | STRING | The partition specification. Example: time=20130222,loc=beijing. |
| data_size | BIGINT | The data size in bytes. |
| block_id | BIGINT | The block ID for uploads. Only populated when operate_type is UPLOADLOG. |
| offset | BIGINT | The number of records skipped before download. Default: 0. |
| length | BIGINT | The number of records transferred in the session. |
| owner_id | STRING | The ID of the Alibaba Cloud account. |
| owner_name | STRING | The name of the Alibaba Cloud account. |
| start_time | DATETIME | The request start time. |
| end_time | DATETIME | The request end time. |
| client_ip | STRING | The IP address of the client. |
| user_agent | STRING | Client information, such as Java version or operating system. |
| columns | STRING | The columns specified for download. |
| ds | STRING | The date when data was collected. Example: 20190101. |
What's next
-
Tenant-level Information Schema — use this for projects created on or after March 1, 2024, or to query metadata across multiple projects.
-
Assign a role to a user — manage the Super_Administrator role required to install the permission package.
-
Cross-project resource access based on packages — manage Information Schema access for other users and roles.