Updated on 2024-12-18 GMT+08:00

Mapping Rules for Automatic Table Creation

To ensure that data is completely imported to the migration destination, correctly configure field mappings based on data types supported for different data sources. For details, see Table 1.

Table 1 Supported data types

Data Connection Type

Data Type

MySQL

See Data Types Supported for Automatic Table Creation at the Destination When the Source Is a MySQL Database.

Data Types Supported for Automatic Table Creation at the Destination When the Source Is a MySQL Database

When the source is an MySQL database and the destination is MySQL, the following data types are supported for automatic table creation:

Table 2 Data types supported for the open-source MySQL database

Category

Type

Description

Hudi

Character string

CHAR(M)

A fixed-length string of 1 to 255 characters, for example, CHAR(5).

The length limit is not mandatory. It is set to 1 by default.

STRING

VARCHAR(M)

A variable-length string consists of 1 to 255 characters (more than 255 characters for MySQL of a later version). Example: VARCHAR(25).

When creating a field of the VARCHAR type, you must define the length.

STRING

Value

DECIMAL(M,D)

Uncompressed floating-point numbers cannot be unsigned. In unpacking decimals, each decimal corresponds to a byte.

Defining the number of display lengths (M) and decimals (D) is required. NUMERIC is the synonym of DECIMAL.

DECIMAL

NUMBERIC

Same as DECIMAL

Not supported

INTEGER

An integer of normal size that can be signed. If the value is signed, it ranges from -2147483648 to 2147483647.

If the value is unsigned, the value ranges from 0 to 4294967295. Up to 11-bit width can be specified.

INT

INTEGER UNSIGNED

Unsigned form of INTEGER

BIGINT

INT

Same as INTEGER

INT

INT UNSIGNED

Same as INTEGER UNSIGNED

BIGINT

BIGINT

A large integer that can be signed. If the value is signed, it ranges from -9223372036854775808 to 9223372036854775807. If the value is unsigned, the value ranges from 0 to 18446744073709551615. Up to 20-bit width can be specified.

BIGINT

BIGINT UNSIGNED

Unsigned form of BIGINT

DECIMAL(20, 0)

MEDIUMINT

A medium-sized integer that can be signed. If the value is signed, it ranges from -8388608 to 8388607.

If the value is unsigned, it ranges from 0 to 16777215, and you can specify a maximum of 9-bit width.

INT

MEDIUMINT UNSIGNED

Unsigned form of MEDIUMINT

BIGINT

TINYINT

A very small integer that can be signed. If signed, the value ranges from -128 to 127.

If unsigned, the value ranges from 0 to 255, and you can specify a maximum of 4-bit width.

INT

TINYINT UNSIGNED

Unsigned form of TINYINT

INT

BOOLEAN

The bool of MySQL is tinyint(1).

BOOLEAN

SMALLINT

A small integer that can be signed. If the value is signed, it ranges from -32768 to 32767.

If unsigned, the value ranges from 0 to 65535, and you can specify a maximum of 5-bit width.

INT

SMALLINT UNSIGNED

Unsigned form of SMALLINT

INT

REAL

Same as DOUBLE

Not supported

FLOAT(M,D)

Unsigned floating-point numbers cannot be used. The display length (M) and number of decimal places (D) can be specified. This is not mandatory, and the default value is 10,2. In the preceding information, 2 indicates the number of decimal places and 10 indicates the total number of digits (including decimal places). The decimal precision can reach 24 floating points.

FLOAT

DOUBLE(M,D)

Unsigned double-precision floating-point numbers cannot be used. The display length (M) and number of decimal places (D) can be specified. This is not mandatory.

The default value is 16,4, where 4 is the number of decimal places. The decimal precision can reach 53-digit. REAL is a synonym of DOUBLE.

DOUBLE

DOUBLE PRECISION

Similar to DOUBLE

DOUBLE

Bit

BIT(M)

Stored bit type value. BIT(M) can store up to M bits of values, and M ranges from 1 to 64.

Not supported

Time and date

DATE

The value is in the YYYY-MM-DD format and ranges from 1000-01-01 to 9999-12-31. For example, December 30, 1973 will be stored as 1973-12-30.

DATE

TIME

Stores information about the hour, minute, and second.

STRING

DATETIME

The date and time are in the YYYY-MM-DD HH:MM:SS format and range from 1000-01-01 00:00:00 to 9999-12-31 23:59:59. For example, 3:30 p.m. on December 30, 1973 will be stored as 1973-12-30 15:30:00.

TIMESTAMP

TIMESTAMP

Timestamp type. Timestamp between midnight on January 1, 1970 and a time point in 2037. Similar to the DATETIME format (YYYYMMDDHHMMSS), except that no hyphen is required. For example, 3:30 p.m. December 30, 1973 will be stored as 19731230153000.

TIMESTAMP

YEAR(M)

The year is stored in 2-digit or 4-digit number format. If the length is specified as 2 (for example, YEAR(2)), the year ranges from 1970 to 2069 (70 to 69). If the length is specified as 4, the year ranges from 1901 to 2155. The default length is 4.

STRING

Multimedia (binary)

BINARY(M)

The number of bytes is M. The length of a variable-length binary string ranges from 0 to M. M is the value length plus 1.

Not supported

VARBINARY(M)

The number of bytes is M. A fixed binary string with a length of 0 to M.

Not supported

TEXT

The maximum length of the field is 65535 characters. TEXT is a "binary large object" and is used to store large binary data, such as images or other types of files.

STRING

TINYTEXT

A binary string of 0 to 255 bytes in short text

STRING

MEDIUMTEXT

A binary string of 0 to 167772154 bytes in medium-length text

STRING

LONGTEXT

A binary string of 0 to 4294967295 bytes in large-length text

STRING

BLOB

The maximum length of the field is 65535 characters. BLOB is a "binary large object" and is used to store large binary data, such as images or other types of files. BLOB is case-sensitive.

Not supported

TINYBLOB

A binary string of 0 to 255 bytes in short text

Not supported

MEDIUMBLOB

A binary string of 0 to 167772154 bytes in medium-length text

Not supported

LONGBLOB

A binary string of 0 to 4294967295 bytes in large-length text

Not supported

Special type

SET

SET is a string object that can have no or multiple values. The values come from the allowed column of values specified when the table is created. When specifying the SET column values that contain multiple SET members, separate the members with commas (,). The SET member value cannot contain commas (,).

-

JSON

-

STRING

ENUM

When an ENUM is defined, a list of its values is created, which are the items that must be used for selection (or NULL). For example, if you want a field to contain "A", "B", or "C", you can define an ENUM ("A", "B", or "C"). Only these values (or NULL) can be used to fill in the field.

Not supported