Common questions about getting started with MaxCompute.
Implicit data type conversions fail in a new project
If you set odps.sql.type.system.odps2 to true, the MaxCompute V2.0 data type edition is enabled. This edition restricts implicit data type conversions, so queries that relied on implicit casting may fail.
To restore implicit conversion behavior, set odps.sql.type.system.odps2 to false:
SET odps.sql.type.system.odps2 = false;
This disables the V2.0 data type edition and re-enables implicit conversions.
How do I create a table?
The quickest path for most users is to run a CREATE TABLE statement on the MaxCompute client:
CREATE TABLE my_table (
id BIGINT,
name STRING
);
Two additional methods are available if you prefer a visual interface or want to integrate with a data development workflow:
| Method | Best for |
|---|---|
| MaxCompute Studio — table schema editor | Visual table design and management |
| DataWorks console — Workspace Tables tab on the DataStudio page | Integration with DataWorks pipelines |
For SQL syntax details, see Common SQL statements. For MaxCompute Studio table management, see Manage internal tables, external tables, or views in a visualized manner. For the DataWorks console, see Manage tables.
How do I run SQL statements?
Four options are available:
| Method | Best for |
|---|---|
| DataWorks console | Interactive queries and workflow integration |
| MaxCompute client | Command-line access and scripting |
| SDK | Programmatic submission from application code |
| Java Database Connectivity (JDBC) driver | Connecting BI tools and Java applications |
How do I load data into MaxCompute?
Choose a tool based on your scenario:
| Scenario | Recommended tool |
|---|---|
| Small files or quick tests | MaxCompute client |
| Large-scale batch ingestion | Tunnel SDK |
| ETL pipelines and scheduled syncs | Data Integration (DataWorks) |
| Migration from Hadoop or RDBMS | Apache Sqoop |
| Streaming log data | Flume, Fluentd, or Logstash |
| Interactive uploads via UI | MaxCompute Studio |
For an overview of all supported tools, see Data migration tools.
How do I recover accidentally deleted table data?
MaxCompute automatically retains a snapshot of your data before any deletion or modification. Within the backup retention period, you can restore the original data.
Recovery is only possible within the backup retention window. Once the retention period expires, the backup is permanently removed and the data cannot be recovered.
For restore commands and full details, see Backup and restoration.
Can I query tables across projects?
Yes. Reference a table in another project using <project_name>.<table_name>:
SELECT * FROM other_project.my_table;
This requires that the project owner or an authorized user grants you the necessary permissions first. MaxCompute supports three authorization methods:
-
Access control list (ACL)-based authorization — Grant permissions to specific users or roles
-
Policy-based authorization — Apply permission policies at the project level
-
Resource access across projects — Enable cross-project resource sharing
For details on setting up permissions, see Permission overview.