MMS migration migration rules

Updated at:

When MaxCompute Migration Service (MMS) synchronizes metadata from external data sources to MaxCompute, it migrates source table types and column data types to the corresponding types supported by MaxCompute. Because type systems vary across data sources, MMS defines a set of standardized migration rules to ensure metadata integrity and accuracy during migration. This topic describes the table type and column data type migration rules from each supported data source (BigQuery, Hive, Databricks, Snowflake, and Redshift) to MaxCompute.

BigQuery

This section describes the migration rules from BigQuery to MaxCompute.

Migration objects

Standard BigQuery tables. Views are not included.

Table type migration

By default, all tables are migrated to MaxCompute Append Delta Tables.

Data type migration

Source data type

MaxCompute data type

BOOL

BOOLEAN

INT64

BIGINT

FLOAT64

DOUBLE

NUMERIC(p, s)

DECIMAL(p, s)

NUMERIC (precision not specified)

DECIMAL(38, 9)

NUMERIC(p)

DECIMAL(p, 0)

BIGNUMERIC(p, s) (p <= 38 and s <= 30)

DECIMAL(p, s)

BIGNUMERIC(p, s) (p > 38 or s > 30)

Not supported

BIGNUMERIC(p) (p <= 38)

DECIMAL(p, 0)

BIGNUMERIC(p) (p > 38)

Not supported

BIGNUMERIC (precision not specified)

DECIMAL(38, 18)

STRING

STRING

BYTES

BINARY

TIMESTAMP

TIMESTAMP_NTZ

DATE

DATE

TIME

LONG

  • The precision and scale (p, s) of the BIGNUMERIC type are user-configurable. The recommended default is DECIMAL(38, 18).

  • The BigQuery TIME type stores the number of microseconds since midnight and maps to BIGINT.

  • MaxCompute does not support JSON types nested inside STRUCT or ARRAY types.

    • Only BigQuery ARRAY&lt;JSON&gt; can be migrated to MaxCompute ARRAY&lt;STRING&gt;.

    • Other nested JSON patterns such as ARRAY&lt;ARRAY&lt;JSON&gt;&gt; and STRUCT&lt;a: JSON&gt; are not supported.

Partitioned table migration rules

1. Time-unit column partitioning table

Example BigQuery table schema:

CREATE TABLE IF NOT EXISTS pt_datetime
(
    i  INT,
    dt DATETIME
) PARTITION BY DATE (dt);

Plan (default, recommended)

Migrate to Auto partition table based on time computing function.

CREATE TABLE IF NOT EXISTS pt_datetime(
  i BIGINT, 
  dt TIMESTAMP_NTZ)
AUTO PARTITIONED BY (TRUNC_TIME(dt, 'DAY') AS `_partition_value`) 
TBLPROPERTIES ('table.format.version'='2', 'transactional'='true');
  • MaxCompute does not support partitioning by DATE, DATETIME, or TIMESTAMP types. When migrating to a partitioned table, these types are converted to STRING.

  • Values earlier than 1960-01-01 or later than 2159-12-31 are inserted into the __UNPARTITIONED__ partition in BigQuery, and MaxCompute handles them the same way.

2. Ingestion time partitioning table

When a table is created without specifying a partition column, BigQuery automatically generates a pseudo-column to record the data insertion time for partitioning.

This is roughly equivalent to specifying a _partitiontime DATETIME partition column, but the pseudo-column does not appear in SELECT results unless explicitly specified.

Example BigQuery table schema:

CREATE TABLE IF NOT EXISTS pt_pseudo_date
(
    i INT
) PARTITION BY _PARTITIONDATE;

SELECT *, _PARTITIONTIME AS pt FROM pt_pseudo_date;

CREATE TABLE IF NOT EXISTS pt_pseudo_hour
(
    i INT
) PARTITION BY timestamp_trunc(_PARTITIONTIME, hour);

Plan (default, recommended)

Migrate to MaxCompute Ingestion-time partitioned tables.

CREATE TABLE IF NOT EXISTS pt_pseudo_date(
  i BIGINT,
  `_partitiontime` TIMESTAMP COMMENT 'bigquery _PARTITIONTIME') 
AUTO PARTITIONED BY (TRUNC_TIME(`_PARTITIONTIME`, 'DAY') AS `_partition_value`) 
STORED AS ALIORC TBLPROPERTIES ('table.format.version'='2', 'transactional'='true');
  • MaxCompute does not support partitioning by DATE, DATETIME, or TIMESTAMP types. When migrating to a partitioned table, these types are converted to STRING.

  • Values earlier than 1960-01-01 or later than 2159-12-31 are inserted into the __UNPARTITIONED__ partition in BigQuery, and MaxCompute handles them the same way.

Range partitioned table

Example BigQuery table schema:

CREATE TABLE IF NOT EXISTS pt_range_cluster
(
    i INT,
    j INT
) PARTITION BY range_bucket(i, GENERATE_ARRAY(0, 11, 3)) cluster by (j);

Plan (default):

Migrate to a MaxCompute partitioned table.

CREATE TABLE IF NOT EXISTS pt_range_cluster(i BIGINT, j BIGINT)
PARTITIONED BY
    (`_partition_value` STRING COMMENT 'bigquery range value')
RANGE CLUSTERED BY (j)
TBLPROPERTIES ('table.format.version' = '2', 'transactional' = 'true');

Other limitations

Limitation

BigQuery

MaxCompute

Table name

<= 1024 characters, standard Unicode characters allowed

<= 128 characters, only letters, digits, and underscores allowed

Column name

<= 300 characters

<= 128 characters, only letters, digits, underscores, and Chinese characters allowed

Maximum columns per table

10,000

1,200

Hive and data lakehouse migration

This section describes the migration rules from Hive to MaxCompute.

Supported cloud products

Cloud product

Metadata service

Data storage

Self-managed Hive cluster

HMS

HDFS

Alibaba Cloud EMR

HMS

HDFS, OSS

AWS

HMS, GLUE

S3, HDFS

Huawei Cloud MRS

HMS

HDFS, OBS

Migration objects

Standard managed tables and external tables. Views are not supported.

Table type migration

  • Hive standard tables are migrated to MaxCompute standard tables.

  • Data lake table formats (Iceberg, Hudi, Paimon) managed by Hive as the metadata service also apply.

Column data type migration

Source 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

DATE

DATE

ARRAY

ARRAY

MAP

MAP

STRUCT

STRUCT

UNION

UNION

Partition column migration rules

For Hive table partition columns, the migration rules are as follows:

  • STRING, VARCHAR, CHAR, TINYINT, SMALLINT, INT, and BIGINT partition columns retain their original type migration.

  • All other partition column types are converted to STRING.

Note

The Hive 3 TIMESTAMP_NTZ type is not supported. If a source table contains columns of this type, the column is skipped or an error is reported during synchronization. Verify the column types of your source table before synchronization.

Databricks

This section describes the migration rules from Databricks to MaxCompute.

Migration objects

Delta Table and Non-Delta Table. Views are not included.

Table type migration

Source table type

MaxCompute table type

Delta Table (with primary key)

PK Delta tables

Delta Table (without primary key)

Append Delta Table

Non-Delta Table

Append Delta Table

Data type migration

Source data type

MaxCompute data type

TINYINT

TINYINT

SMALLINT

SMALLINT

INT

INT

BIGINT

BIGINT

FLOAT

FLOAT

DOUBLE

DOUBLE

BOOLEAN

BOOLEAN

STRING

STRING

BINARY

BINARY

DATE

DATE

TIMESTAMP

TIMESTAMP

TIMESTAMP_NTZ

TIMESTAMP_NTZ

ARRAY\<elementType\>

ARRAY\<elementType\>

MAP\<keyType, valueType\>

MAP\<keyType, valueType\>

STRUCT\<...\>

STRUCT\<...\>

INTERVAL

Not supported

VOID

Not supported

VARIANT

Not supported

OBJECT

Not supported

Note

The INTERVAL, VOID, VARIANT, and OBJECT types cannot be mapped to MaxCompute types. If a source table contains columns of these types, the columns are skipped during synchronization.

Partition column migration rules

  • For Databricks table partition columns, the migrationrules are as follows: STRING, VARCHAR, CHAR, TINYINT, SMALLINT, INT, and BIGINT partition columns retain their original type migration.

  • All other partition column types are converted to STRING.

Snowflake

This section describes the migration rules from Snowflake to MaxCompute. The Snowflake NUMBER type maps to different MaxCompute types depending on the scale (S) value.

Migration objects

Standard managed tables.

Table type migration

All tables are migrated to standard tables.

Data type migration

Source data type

MaxCompute data type

NUMBER(P,S), S > 30

STRING

NUMBER(P,S), 30 >= S > 0

DECIMAL(P, S)

NUMBER(P,S), S = 0

BIGINT (default) or DECIMAL(P, 0)

DOUBLE

DOUBLE

DECFLOAT

STRING

STRING

STRING

BINARY

BINARY

BOOLEAN

BOOLEAN

DATE

DATE

TIME

STRING (HH:MM:SS.SSSSSSSSS format)

TIMESTAMP_LTZ

TIMESTAMP

TIMESTAMP_NTZ

TIMESTAMP_NTZ

TIMESTAMP_TZ

TIMESTAMP_NTZ

VARIANT

JSON

ARRAY

JSON

OBJECT

JSON

ARRAY(elementType)

ARRAY\<elementType\>

OBJECT(fieldName fieldType, ...)

STRUCT\<fieldName: fieldType, ...\>

MAP(keyType, valueType)

MAP\<keyType, valueType\>

GEOGRAPHY

STRING

GEOMETRY

STRING

FILE

Not supported

VECTOR

Not supported

Note
  • When Snowflake complex types (ARRAY, OBJECT, MAP) contain nested semi-structured types, the semi-structured types are converted to STRING.

  • Unstructured Snowflake ARRAY and OBJECT types map to JSON, while structured ARRAY(elementType), OBJECT(fieldName fieldType, ...), and MAP(keyType, valueType) map to the corresponding MaxCompute complex types.

  • The FILE and VECTOR types are not supported.

Redshift

This section describes the migration from Redshift to MaxCompute.

Migration objects

Full migration of Redshift managed table data. Views are not included.

Table type migration

Redshift tables are migrated to non-partitioned MaxCompute tables. The specific table type migration is as follows.

DistStyle

SortKey type

MaxCompute table type

Cluster

Has primary key

Any

PK Delta tables

Primary key Hash Cluster

KEY/AUTO(KEY)

Compound

Append Delta Table

RANGE BY (SortKey)

KEY/AUTO(KEY)

Interleaved

Append Delta Table

RANGE BY (SortKey)

KEY/AUTO(KEY)

None

Append Delta Table

RANGE BY (DistKey)

EVEN/AUTO(EVEN)

Compound

Append Delta Table

RANGE BY (SortKey)

EVEN/AUTO(EVEN)

Interleaved

Append Delta Table

RANGE BY (SortKey)

EVEN/AUTO(EVEN)

None

Append Delta Table

No suitable column

ALL/AUTO(ALL)

Compound

Append Delta Table

RANGE BY (SortKey)

ALL/AUTO(ALL)

Interleaved

Append Delta Table

RANGE BY (SortKey)

ALL/AUTO(ALL)

None

Append Delta Table

Default Cluster Key

Data type migration

Redshift data type

MaxCompute data type

SMALLINT (INT2)

SMALLINT

INTEGER (INT, INT4)

INT

BIGINT (INT8)

BIGINT

DECIMAL(precision,scale) (NUMERIC)

DECIMAL(precision,scale)

REAL (FLOAT4)

FLOAT

DOUBLE PRECISION (FLOAT8, FLOAT)

DOUBLE

CHAR(n) (CHARACTER/NCHAR/BPCHAR)

STRING

VARCHAR(n) (CHARACTER VARYING/NVARCHAR/TEXT)

STRING

DATE

DATE

TIME

STRING

TIMETZ

STRING

TIMESTAMP

TIMESTAMP_NTZ

TIMESTAMPTZ

TIMESTAMP

BOOLEAN (BOOL)

BOOLEAN

HLLSKETCH

Not supported

SUPER

STRING

VARBYTE(n) (VARBINARY)

BINARY

GEOMETRY

STRING

GEOGRAPHY

STRING

Known limitations

Limitation

Redshift

MaxCompute

Impact

HLLSKETCH type

Supported

Not supported

Tables with HLLSKETCH columns cannot be migrated. Remove the column or use an alternative approximate distinct solution.

VARBYTE length

Maximum 16 MB

Maximum 8 MB

Values exceeding 8 MB require processing.

Column count

1,600

1,200

Tables exceeding 1,200 columns require splitting.

Auto-increment columns

IDENTITY supported

Not supported

Auto-increment properties are lost during migration.

MaxCompute

MaxCompute-to-MaxCompute migration preserves the source table types and column types. Currently supported migration objects include: tables, views, materialized views, resources, UDFs, and project flags.