SQL limitations

Updated at:

This topic describes the limitations of using MaxCompute SQL in Dataphin.

Limit

Value

Category

Description

Table name length

128 bytes

length limit

A table name cannot contain special characters. It must start with a letter and must only contain lowercase letters (a-z), uppercase letters (A-Z), digits, and underscores (_).

Column name length

128 bytes

length limit

  • A column name is case-insensitive. It cannot contain special characters but can contain letters (a-z, A-Z), digits, underscores (_), and Chinese characters. We recommend that column names start with a letter. The maximum length is 128 bytes. Exceeding this limit causes an error.

  • When you enable BigQuery compatible mode by running the SET odps.sql.bigquery.compatible=true; command, the maximum column name length is 256 bytes. Exceeding this limit causes an error.

Comment length

1,024 bytes

length limit

A valid string of up to 1,024 bytes.

Columns per table

1,200

quantity limit

A table can have up to 1,200 columns.

Partitions per table

60,000

quantity limit

A table can have up to 60,000 partitions.

Partition hierarchy levels per table

6

quantity limit

The partition hierarchy in a table cannot exceed 6 levels.

Display limit

10,000 rows

quantity limit

A SELECT statement can return a maximum of 10,000 rows.

INSERT targets

256

quantity limit

In a MULTI-INSERT operation, you can write to a maximum of 256 tables.

UNION ALL

256

quantity limit

In a UNION ALL operation, you can merge a maximum of 256 tables.

MAPJOIN

128

quantity limit

In a MAPJOIN operation, you can join a maximum of 128 small tables.

MAPJOIN memory limit

512 MB

quantity limit

In a MAPJOIN operation, the total size of all small tables in memory cannot exceed 512 MB.

ptinsubq (partition in subquery)

1,000 rows

quantity limit

If a subquery references a partition column, it cannot return more than 1,000 rows.

SQL statement length

2 MB

length limit

The maximum length of an SQL statement is 2 MB. This limit also applies to SQL calls made through an SDK.

Cell size

8 MB

quantity limit

A single cell in a table cannot exceed 8 MB.

Arguments in an IN clause

1,024

quantity limit

The maximum number of parameters in an IN clause is limited, for example, in (1,2,3….,1024). If the in(...) clause contains too many parameters, compilation performance is affected. 1024 is a recommended value, not a hard limit.

jobconf.json size

1 MB

length limit

The maximum size for jobconf.json is 1 MB. If a table has a large number of partitions, the size of jobconf.json might exceed this limit.

View

Read-only

operation limit

Views are read-only. INSERT operations are not supported.

Column data type

Not modifiable

operation limit

You cannot modify the data type or position of a column.

Java UDF

Cannot be ABSTRACT or STATIC.

operation limit

A Java UDF cannot be ABSTRACT or STATIC.

Partitions per query

10,000

quantity limit

A query can scan up to 10,000 partitions.

SQL execution plan length

1 MB

length limit

The execution plan for a MaxCompute SQL query cannot exceed 1 MB. If a plan exceeds this limit, MaxCompute reports the error FAILED: ODPS-0010000:System internal error - The Size of Plan is too large.

Maximum job execution time

72 hours

runtime limit

The default maximum execution time for a single SQL job is 24 hours. You can increase it to 72 hours by setting the following parameter. An SQL job cannot run for more than 72 hours. If a job exceeds this 72-hour limit, MaxCompute automatically stops it.

SET odps.sql.job.max.time.hours=72;

Table partition creation frequency

120 operations/15 seconds

frequency limit

The ALTER TABLE <table_name> ADD PARTITION <pt_spec> operation has a frequency limit of 120 operations per 15 seconds.

Note

Some of the MaxCompute SQL limits described in this topic cannot be changed.