The MaxCompute console provides SQL analysis for running SQL statements and managing the MaxCompute data catalog in a single interface. Built on the DataWorks Data Development (DataStudio) feature, SQL analysis offers:
Intelligent SQL editor -- edit, run, and debug SQL directly in the console.
Data catalog -- manage metadata for projects, schemas, tables, and views.
Built-in public datasets and demo scripts -- run pre-built SQL files to test MaxCompute features.
SQL analysis is currently available in the Indonesia (Jakarta) region only. More regions will be supported soon.
Prerequisites
Before you begin, make sure that you have:
Activated MaxCompute and DataWorks
Created a MaxCompute project
Enable SQL analysis
Log in to the MaxCompute console and select a region in the top-left corner.
In the left navigation pane, choose Data Exploration > SQL Analysis.
In the dialog box, activate DataWorks if it is not already active. Click Open immediately. After activation, click Try New Version to open the new SQL analysis page.
Activation requires the pay-as-you-go (free) DataWorks Basic Edition or a higher edition. For details, see Features of DataWorks editions.
The new SQL analysis stores SQL files in a cloud-based personal folder. Local files from the previous version are not automatically synchronized. Manually move them to your personal folder to continue editing.
Manage SQL files in the resource manager
The resource manager organizes SQL script files into directories. A search-and-replace function lets you find and replace content across all files.
| Directory | Path | Description |
|---|---|---|
| Personal Folder (Recommended) | EXPLORER > PERSONAL DIRECTORY > My Files | Cloud-based directory for SQL scripts. Create folders and .sql files as needed. Right-click items to move, rename, or delete. Only .sql files are supported. Click a filename to open it in the editor. |
| Workspace | EXPLORER > WORKSPACE | Manages SQL scripts from a local file system. Open a local folder or .sql file, then save edits back to your machine. Grant access to the local folder each time the page loads. Alibaba Cloud does not store local folder content on its servers. |
| Public Dataset Demo | EXPLORER > COMMONDATASET DEMO | Built-in demo query files that run directly. Temporary edits are allowed but cannot be saved -- save modified content yourself. Each file may contain multiple queries. The number before -query in the filename indicates the query count. For example, TPC-DS demo files each contain 99 queries of different data sizes. Running these queries consumes computing resources. |
If you used the old SQL analysis, the workspace directory and your SQL scripts are retained by default. If you never used it, the WORKSPACE section is hidden.
Browse and manage the data catalog
The data catalog provides a unified interface to create and manage MaxCompute data objects such as tables, views, external tables, resources, and functions.
| Feature | Description |
|---|---|
| Add and remove projects | Go to Data Catalog > MAXCOMPUTE. All MaxCompute projects accessible to your tenant are listed as datasets by default. Click the project list icon to create or remove projects. |
| Manage objects | Click the action icon next to a project to add and manage schemas, tables, and views. DataWorks Copilot integration supports intelligent table creation with automatic field and description generation. For details, see Manage MaxCompute data catalog. |
| Public datasets | Go to Data Catalog > Public Datasets. MaxCompute provides public datasets in the BIGDATA_PUBLIC_DATASET project for evaluation. Browse schemas, tables, and field details. For more information, see Public datasets overview. |
Write and run SQL in the editor
The SQL editor supports standard SQL operations (SELECT, INSERT, UPDATE, DELETE) along with MaxCompute-specific syntax and functions. For a full syntax reference, see SQL overview.
The editor page has three areas: the editor area, runtime parameters, and the results area.
Editor area
| Action | Description |
|---|---|
| Run | Execute the SQL script. Select a segment to run only that part. Without a selection, all SQL in the file runs. |
| Stop | Stop a running script. Available after you click Run. |
| Save | Save the current SQL file and its configurations. |
| Format | Format SQL code in the file. Useful for long single-line statements. |
| SQL Scan Estimate | Estimate cost by running a COST SQL statement. Returns the scan size and complexity. For details, see COST SQL. |
The editor supports full-screen mode for writing code, running scripts, and viewing results.
If a file contains multiple SQL scripts, place all SET statements (flags) at the beginning. They apply to every script in that file.
Runtime parameters
| Parameter | Description |
|---|---|
| Type | File type. Defaults to MaxCompute SQL. |
| Project | Required. Select the project for execution. Your account must have create instance permission on the project. You must select a project for the first run. The system caches your selection and uses it for subsequent runs. |
| Computing Quota | Optional. Select the computing quota to use. Your account must have usage permission. If omitted, the project's default computing quota applies. |
| Script parameters | Define variables in code with the ${parameter_name} format. Configure values in this section. Variables are replaced dynamically at runtime. |
Results area
| Tab | Description |
|---|---|
| Problems | Automatically checks syntax and standards for all open scripts before execution. Surfaces compliance issues early. |
| SQL Scan Estimate | Displays the execution log and results of the COST SQL statement. |
| Result | Shows script execution results with the following sub-tabs. |
Result sub-tabs:
| Sub-tab | Description |
|---|---|
| Run List | Lists each run with a start time. Click a record to view details. |
| SQL | Displays the SQL code for a specific run. |
| Log | Displays the execution log. |
| Result | Shows results in a spreadsheet format. |
| Analysis | Provides chart-based analysis of results. |
Related topics
MaxCompute SQL node -- develop MaxCompute SQL in DataStudio.
Features of DataWorks editions -- compare DataWorks editions.
Public datasets overview -- explore available public datasets.
COST SQL -- estimate query cost before execution.