All Products
Search
Document Center

MaxCompute:Data type mappings between MaxCompute and Hive, MySQL, and Oracle

Last Updated:Apr 08, 2024

When you import data from a database to MaxCompute or export data from MaxCompute to another database during data migration or integration, you must configure the data type mappings of table fields based on the data type mapping table provided in this topic. Correct data type mappings can ensure that data is correctly stored, processed, and queried in different databases. This prevents data loss or damage and improves work efficiency. This topic describes the data type mappings between MaxCompute and Hive, Oracle, and MySQL.

Data type mapping table

The following table describes the data type mappings between MaxCompute and Hive, Oracle, and MySQL.

Data type of MaxCompute

Data type of Hive

Data type of Oracle

Data type of MySQL

BOOLEAN

BOOLEAN

None

Note

This data type is supported in Oracle Database 23c and later.

None

Note

TINYINT(1) is used instead.

TINYINT

TINYINT

NUMBER(3,0)

TINYINT

SMALLINT

SMALLINT

NUMBER(5,0)

SMALLINT

INT

INT

NUMBER(7,0)

MEDIUMINT

INT

INT

NUMBER(10,0)

INT

BIGINT

BIGINT

NUMBER(20,0)

BIGINT

FLOAT

FLOAT

BINARY_FLOAT

Note

This data type is supported in Oracle Database 10g and later.

FLOAT

DOUBLE

DOUBLE

BINARY_DOUBLE

Note

This data type is supported in Oracle Database 10g and later.

DOUBLE

DECIMAL

DECIMAL

NUMBER(P,S)

  • DECIMAL

  • NUMERIC

STRING

STRING

  • VARCHAR

  • VARCHAR2

  • CHAR

  • NCHAR

  • NVARCHAR3

  • VARCHAR

  • CHAR

VARCHAR

VARCHAR

  • VARCHAR

  • VARCHAR2

  • CHAR

  • NCHAR

  • NVARCHAR3

VARCHAR

STRING

CHAR

CHAR

CHAR

BINARY

BINARY

RAW

  • BINARY

  • VARBINARY

TIMESTAMP

TIMESTAMP

TIMESTAMP WITH TIME ZONE

TIMESTAMP

TIMESTAMP_NTZ

TIMESTAMP

Note

This data type is supported in Hive 3 and later.

DATETIME

TIMESTAMP

DATE

DATE

DATE

DATE

DATETIME

DATE

DATE

DATETIME

ARRAY

ARRAY

Not supported

Not supported

MAP

MAP<key,value>

Not supported

Not supported

STRUCT

STRUCT

Not supported

Not supported

Not supported

UNION

Not supported

Not supported

Not supported

Not supported

BLOB

BLOB

References