MaxCompute SQL lets you manage all core objects—projects, tables, resources, instances, functions, tunnels, and external volumes—through a unified set of commands. This page groups those commands by object type so you can quickly locate the statement you need and jump to its full syntax reference.
For statements not listed here, see All statements (in alphabetical order) or Function Reference.
Keywords, project names, table names, and column names in MaxCompute SQL are not case sensitive. To run these operations programmatically, see MaxCompute SDK.
Statement reference
Project operations
A project is the top-level namespace in MaxCompute. Use these commands to switch between projects, inspect or change project properties, and manage the account systems (RAM) associated with a project.
| Statement | Description |
|---|---|
| use | Switch to a project |
| setproject (view) | View the properties of a project |
| setproject (configure) | Configure project properties |
| list accountproviders | View the account systems of a project |
| add | Add the RAM account system |
| remove | Remove the RAM account system |
SET operations
Use SET and SHOW FLAGS to configure session-level flags and inspect their current values within a MaxCompute session.
| Statement | Description |
|---|---|
| SET | Set a session-level flag |
| SHOW FLAGS | View current session flag values |
Security operations
These commands control data protection and cross-project trust. They are typically run by project administrators. Use them to enable project-level data protection, manage trusted projects that are allowed to access protected data, and inspect the security configuration of a project.
| Statement | Description |
|---|---|
| ProjectProtection | Enable project data protection |
| add trustedproject | Add a trusted project |
| remove trustedproject | Remove a trusted project |
| list trustedprojects | View trusted projects |
| show SecurityConfiguration | View the security configuration of a project |
User and role operations
Use these commands to add or remove users in a project, create and delete roles, and assign roles to users. Roles group permissions together—granting a role to a user gives them all permissions associated with that role.
| Statement | Description |
|---|---|
| add user | Add a user to a project |
| remove user | Remove a user from a project |
| list users | View all users in a project |
| create role | Create a role |
| list roles | View all roles in a project |
| grant | Assign a role to a user |
| revoke | Remove a user from a role |
| drop role | Delete a role |
Authorization operations
Use grant and revoke to control which users or roles can access specific resources within a project.
| Statement | Description |
|---|---|
| grant | Grant permissions to a role or user |
| revoke | Revoke permissions from a role or user |
Table operations
These are the most frequently used commands in MaxCompute. They cover the full lifecycle of tables and views: creating, modifying ownership, dropping, and inspecting tables, partitions, and views.
| Statement | Description |
|---|---|
| create table | Create a table |
| alter table | Change the owner of a table |
| drop table | Drop a table |
| desc | View information about tables or views |
| desc partition | View partition information |
| show tables | List tables and views in a project |
| show partitions | List partitions of a table |
Instance operations
An instance represents a running or completed job in MaxCompute. Use these commands to monitor job status, inspect job details and logs, and stop a running job.
| Statement | Description |
|---|---|
| show | View instance information |
| status | Query the status of an instance |
| top instance | View all currently running instances |
| kill | Stop a running instance |
| desc | Get job information about an instance |
| wait | Get the operational log of jobs in an instance |
Resource operations
Resources are files (such as JAR packages, text files, or archives) that user-defined functions (UDFs) and other jobs depend on. Use these commands to add, inspect, download, alias, and delete resources.
| Statement | Description |
|---|---|
| add | Add a resource |
| View resource information | View resource information |
| View a resource list | View a resource list |
| alias | Create an alias for a resource |
| get | Download a resource |
| drop | Delete a resource |
External volume operations
| Statement | Description |
|---|---|
| Create an external volume | Create an external volume |
| List external volumes | View the list of external volumes and the directory structure of an external volume |
| Delete an external volume | Delete an external volume |
Function operations
These commands manage UDFs (user-defined functions)—custom functions that extend MaxCompute SQL with your own logic. Use them to register, drop, and inspect UDFs, and to view all built-in functions available in MaxCompute.
| Statement | Description |
|---|---|
| create function | Create a UDF |
| drop function | Delete a UDF |
| View the UDF list | View the UDF list |
| View all built-in functions | View all built-in functions |
Tunnel operations
Tunnel is the MaxCompute bulk data transfer tool. Use it to upload data into MaxCompute tables or download data from them at high throughput.
| Statement | Description |
|---|---|
| Tunnel upload | Upload data into MaxCompute |
| Tunnel download | Download data from MaxCompute |
Time zone configuration operations
See Time zone configuration operations for commands to configure time zones for MaxCompute jobs and sessions.
Other operations
| Statement | Description |
|---|---|
| cost sql | Estimate the cost of a SQL statement before running it |
What's next
-
All statements (in alphabetical order) — full alphabetical index of every MaxCompute SQL statement
-
Function Reference — built-in functions grouped by category
-
MaxCompute SDK — run these operations programmatically