This topic describes how table types and data types are mapped between MaxCompute and other data sources.
BigQuery and MaxCompute data type mapping
BigQuery data type | MaxCompute data type |
ARRAY | ARRAY |
BOOLEAN | BOOLEAN |
BYTES | BINARY |
DATE | DATE |
DATETIME | TIMESTAMP_NTZ |
Geography | STRING |
INTERVAL | STRING |
JSON | JSON |
INT64 | BIGINT |
NUMERIC | DECIMAL(38, 9) |
BIGNUMERIC | DECIMAL(x, y) Note The x and y parameters are configurable. The default value is DECIMAL(38, 18). |
FLOAT64 | DOUBLE |
RANGE | STRING |
STRING | STRING |
STRUCT | STRUCT |
TIME | BIGINT |
TIMESTAMP | TIMESTAMP |
Hive and MaxCompute data type mapping
Regular columns
Hive data type | MaxCompute data type |
BOOLEAN | BOOLEAN |
TINYINT | TINYINT |
SMALLINT | SMALLINT |
INT | INT |
BIGINT | BIGINT |
FLOAT | FLOAT |
DOUBLE | DOUBLE |
DECIMAL | DECIMAL |
STRING | STRING |
VARCHAR | VARCHAR |
CHAR | STRING |
BINARY | BINARY |
TIMESTAMP | TIMESTAMP |
TIMESTAMP Note This type is supported in Hive 3 and later versions. | TIMESTAMP_NTZ |
DATE | DATE |
DATE | DATETIME |
ARRAY | ARRAY |
| MAP |
STRUCT | STRUCT |
UNION | UNION |
The Hive 3 TIMESTAMP_NTZ type is not currently supported.
Partition key columns
The STRING, VARCHAR, CHAR, TINYINT, SMALLINT, INT, and BIGINT types retain their original types.
All other types are converted to the STRING type.
Databricks and MaxCompute table type mapping
Databricks table type | MaxCompute table type |
delta table with primary key | pk delta table |
delta table without primary key | append delta table |
non-delta table | append delta table |
Databricks and MaxCompute data type mapping
Databricks data type | MaxCompute data type |
BIGINT | BIGINT |
BINARY | BINARY |
BOOLEAN | BOOLEAN |
DATE | DATE |
DOUBLE | DOUBLE |
FLOAT | FLOAT |
INT | INT |
SMALLINT | SMALLINT |
STRING | STRING |
TIMESTAMP | TIMESTAMP |
TIMESTAMP_NTZ | TIMESTAMP_NTZ |
TINYINT | TINYINT |
STRING | STRING |
TIMESTAMP | TIMESTAMP |
ARRAY <elementType> | ARRAY <elementType> |
STRUCT < fieldName [:] fieldType [not null] [collate collationName] [comment str]... > | STRUCT < fieldName [:] fieldType]... > |
MAP<keyType, valueType> | MAP<keyType, valueType> |
INTERVAL | Not supported |
VOID | Not supported |
VARIANT | Not supported |
OBJECT | Not supported |