Use the SET statement to configure MaxCompute session variables for the current session.
Syntax
SET <key>=<value>Parameters
KEY:The name of the property.
VALUE:The value to assign.
Session properties
The following table lists the properties you can configure with the SET statement. Settings apply only to the current session.
To view the variables configured for the current session, run the SHOW statement. You can also find the values in the SourceXML of LogView 2.0.
Compute resources
Property | Description | Valid values | Default |
| Maximum number of concurrent workers for an entire job. | 1–1000000 | — |
| Memory allocated to each Map worker. | 256–12288 | 1024 MB |
| Memory allocated to each Reduce worker. | 256–12288 | 1024 MB |
| Memory allocated to each Join worker. | 256–12288 | 1024 MB |
| Total memory for all workers in a job. Lower priority than | 256–12288 | — |
| Input data size per Map worker (split size of the input file). Adjusting this value indirectly controls the number of Map workers. | — | 256 MB |
| Number of workers at each Reduce stage. | 1–10000 | — |
| Number of workers at each Join stage. | 1–10000 | — |
| Number of concurrent workers per stage in a MaxCompute job. Lower priority than | 1–10000 | — |
When the LIMIT keyword is used in a SQL statement, concurrency is restricted to a single worker. If you configure any of the above worker-count or split-size properties, omit the LIMIT keyword from your SQL statements.
SQL engine behavior
Property | Description | Valid values | Default |
| Enables dynamic partitioning, which prevents a large number of small files from being generated. Set to |
| — |
| Enables the MaxCompute V2.0 data type edition. |
| — |
| Enables the Hive-compatible data type edition. Required for Hive syntaxes such as |
| — |
| Number of rows the SQL engine processes per batch. Reduce this value if an out-of-memory (OOM) error occurs due to large row fields, or if UDF performance causes timeouts. Avoid setting this too low, as it degrades SQL engine performance. | 1–1024 | 1024 |
| Treats integer constants in a |
| — |
| Enables the anti-skew feature for |
| — |
| Treats integer constants in an |
| — |
| Treats integer constants in both |
| — |
| Python version used when executing SQL statements. |
| — |
| Time zone of the MaxCompute project. For more information, see Time zone configuration operations. | — | — |
| Removes trailing zeros after the decimal point for DECIMAL type values. |
|
|
| Controls whether the MaxCompute client (odpscmd) displays column headers in query results. For more information, see MaxCompute client (odpscmd). |
| — |
| Enables JSON data types. For more information, see Instructions for using JSON data types in MaxCompute. |
| — |
| Converts date strings that include hour, minute, and second parts. |
|
|
| Controls the seed used by the RAND function. |
|
|
| Upper limit on resources consumed by a SQL statement. For more information, see Consumption control. | — | — |
| Maximum duration a single job can run. | 1–72 | 24 hours |
MAPJOIN and data skew
Property | Description | Valid values | Default |
| Memory size for small tables loaded into memory during a MAPJOIN operation. The global memory limit for all small tables in the same task equals | 0–8192 MB | — |
| Enables the SKEWJOIN feature to mitigate long-tail issues. |
| — |
| Specifies the key and value on which SKEWJOIN operates. For more information, see Data skew tuning. | — | — |
Optimizer
Property | Description | Valid values | Default |
| Enables the Shuffle Remove feature for range-clustered tables. |
| — |
| Number of hot key values the optimizer retrieves during an Aggregate operation. For more information, see SKEWJOIN HINT. | — | — |
| Enables the Freeride feature, which automatically collects column statistics for tables. For more information, see Optimizer. |
| — |
| Collection plan for gathering column statistics on specific columns. For more information, see Optimizer. | — | — |
User-defined functions and types
Property | Description | Valid values | Default |
| Maximum Java Virtual Machine (JVM) heap memory for a user-defined function (UDF). Increase this value if UDF workloads cause OOM errors, but also optimize UDF code to address the root cause. | 256–12288 | 1024 MB |
| Timeout period for a UDF. | 0–3600 | 600 seconds |
| Controls whether the GET_JSON_OBJECT function returns the original string as-is. Projects created after April 20, 2021 return original strings by default. Projects created before that date use escape characters for JSON-formatted reserved characters, to avoid affecting existing jobs. For more information, see GET_JSON_OBJECT. |
| — |
| Enables partition pruning for UDFs. For more information, see the "WHERE clause (where_condition)" section in SELECT syntax. |
| — |
| Ignores errors during result backfilling when partition pruning is performed. For more information, see the "WHERE clause (where_condition)" section in SELECT syntax. |
| — |
| Resources referenced by user-defined types (UDTs). Separate multiple resources with commas. For more information, see Overview. | Uploaded resources | — |
| Enables the |
| — |
| Java packages referenced by UDTs. Separate multiple packages with commas. For more information, see Overview. | Uploaded Java packages | — |
Complex type write buffer
Property | Description | Valid values | Default |
| Cache size for storing columns with complex data types (such as STRING, MAP, STRUCT, ARRAY, or BINARY) during table writes. For a table with three complex-type columns, MaxCompute reserves 192 MB (64 × 3) of memory by default. If the output table contains variables of complex types, or if a small table involved in a MAPJOIN operation contains data of complex types, adjusting this property may adversely affect the memory used to run jobs. A large value of this property may cause an OOM error. If a large value causes OOM errors, reduce this property based on actual variable sizes and the | Unit: bytes | 67108864 |
External tables
Property | Description | Valid values | Default |
| Enables virtual private cloud (VPC) for external tables. For more information, see HBase external tables (ApsaraDB for HBase Standard Edition or Performance-enhanced Edition), RDS MySQL external tables, or Hologres external tables. |
| — |
| Enables HTTPS when accessing Object Storage Service (OSS) external tables at the underlying layer. For more information, see Create an OSS external table. |
| — |
| Enables multipart upload to write data to OSS external tables. For more information, see Write data to OSS. |
| — |
| Calls the PutRow operation to write data to a Tablestore external table. For more information, see PutRow. |
| — |
| Maximum concurrency of workers when accessing external tables. | Positive integer | — |
| Uses the native ORC reader to read tables. |
| — |
InstanceTunnel
Property | Description | Valid values | Default |
| Enables InstanceTunnel. For more information, see Usage notes. |
| — |
Security and access control
Property | Description | Valid values | Default |
| Enables LabelSecurity. For more information, see Label-based access control. |
| — |
| Enables ACL-based access control. For more information, see MaxCompute permissions. |
| — |
| Enables policy-based access control. For more information, see Policy-based access control. |
| — |
| Grants object creators access to the objects they create. |
| — |
| Allows object creators to grant other users access to their objects. |
| — |
| Enables project data protection. For more information, see Project data protection. |
| — |
| Specifies the dynamic data masking rule applied to SQL query results. For more information, see Dynamic data masking. | Custom masking rule | — |
| Enables dynamic data masking for a single session. For more information, see Dynamic data masking. |
| — |
Quota
Property | Description | Valid values | Default |
| Name of the quota used to run tasks in the current session. For more information, see Manage quotas in the new MaxCompute console. | — | — |
Examples
Set the input data size per Map worker to 256 MB:
SET odps.stage.mapper.split.size=256;What's next
SHOW: Display properties configured with the SET statement.