All Products
Search
Document Center

MaxCompute:SQL analysis

Last Updated:Feb 28, 2026

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.

Note

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:

Enable SQL analysis

  1. Log in to the MaxCompute console and select a region in the top-left corner.

  2. In the left navigation pane, choose Data Exploration > SQL Analysis.

  3. 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.

Note

Activation requires the pay-as-you-go (free) DataWorks Basic Edition or a higher edition. For details, see Features of DataWorks editions.

Important

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.

DirectoryPathDescription
Personal Folder (Recommended)EXPLORER > PERSONAL DIRECTORY > My FilesCloud-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.
WorkspaceEXPLORER > WORKSPACEManages 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 DemoEXPLORER > COMMONDATASET DEMOBuilt-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.
Note

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.

FeatureDescription
Add and remove projectsGo 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 objectsClick 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 datasetsGo 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

ActionDescription
RunExecute the SQL script. Select a segment to run only that part. Without a selection, all SQL in the file runs.
StopStop a running script. Available after you click Run.
SaveSave the current SQL file and its configurations.
FormatFormat SQL code in the file. Useful for long single-line statements.
SQL Scan EstimateEstimate 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.

Note

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

ParameterDescription
TypeFile type. Defaults to MaxCompute SQL.
ProjectRequired. 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 QuotaOptional. Select the computing quota to use. Your account must have usage permission. If omitted, the project's default computing quota applies.
Script parametersDefine variables in code with the ${parameter_name} format. Configure values in this section. Variables are replaced dynamically at runtime.

Results area

TabDescription
ProblemsAutomatically checks syntax and standards for all open scripts before execution. Surfaces compliance issues early.
SQL Scan EstimateDisplays the execution log and results of the COST SQL statement.
ResultShows script execution results with the following sub-tabs.

Result sub-tabs:

Sub-tabDescription
Run ListLists each run with a start time. Click a record to view details.
SQLDisplays the SQL code for a specific run.
LogDisplays the execution log.
ResultShows results in a spreadsheet format.
AnalysisProvides chart-based analysis of results.

Related topics