For a heterogeneous replication, Data Transmission Service converts columns to data types supported by the target database engine. The following tables list the mappings of source and target types for supported replication pairs.

MySQL-to-AnalyticDB

Source: a user-created MySQL database, ApsaraDB RDS for MySQL database, or Apsara PolarDB for MySQL

Target: an AnalyticDB for MySQL database

MySQL data type AnalyticDB for MySQL data type
BIGINT UNSIGNED decimal(20,0)
BINARY VARBINARY
BIT VARCHAR
BLOB VARBINARY
CHAR varchar
DATE DATE
DATETIME DATETIME
DECIMAL decimal
DOUBLE double
DNUM VARCHAR
FLOAT FLOAT
GEOMETRY VARBINARY
GEOMETRYCOLLECTION VARBINARY
INT UNSIGNED BIGINT
INTEGER int
JSON JSON
LINESTRING VARBINARY
LONGBLOB VARBINARY
LONGTEXT varchar
MEDIUMBLOB VARBINARY
MEDIUMINT int
MEDIUMINT UNSIGNED INT
MEDIUMTEXT varchar
MULTILINESTRING VARBINARY
MULTIPOINT VARBINARY
MULTIPOLYGON VARBINARY
NUMERIC DECIMAL
POINT VARBINARY
POLYGON VARBINARY
SET VARCHAR
SMALLINT UNSIGNED INT
TEXT VARCHAR
TIME TIME
TIMESTAMP TIMESTAMP
TINYBLOB VARBINARY
TINYINT UNSIGNED SMALLINT
TINYTEXT varchar
VARBINARY VARBINARY
VARCHAR varchar
YEAR INT

MySQL-to-Elasticsearch

Source: a user-created MySQL database, ApsaraDB RDS for MySQL database, or Apsara PolarDB for MySQL

Target: Elasticsearch

MySQL data type Elasticsearch data type Description
BIGINT long None
BINARY binary None
BIT long For BIT(1) columns in MySQL, we recommend that you use the BOOLEAN type in Elasticsearch.
BLOB binary None
BOOL or BOOLEAN boolean None
CHAR text None
DATE date The target DATE format is yyyy-MM-dd, in UTC time. For more information, see Date format mappings.
DATETIME date The target DATE format is yyyy-MM-dd'T'HH:mm:ss, in UTC time. A DATE field accurate to the microsecond is notated in the format of yyyy-MM-dd'T'HH:mm:ss.S. For more information, see Date format mappings.
DECIMAL or DEC double If the DECIMAL value contains a decimal point, we recommend that you use the TEXT type in Elasticsearch.
DOUBLE double None
FLOAT float None
GEOMETRY geo_shape None
GEOMETRYCOLLECTION geo_shape None
INT integer For UNSIGNED INT columns in MySQL, we recommend that you use the LONG type in Elasticsearch.
JSON object For a JSON object that carries only 1 bit of information, we recommend that you use the BOOLEAN type in Elasticsearch.
LINESTRING geo_shape None
LONGTEXT text None
MEDIUMINT integer None
MEDIUMTEXT text None
MULTILINESTRING geo_shape None
MULTIPOINT geo_shape None
MULTIPOLYGON geo_shape None
POINT geo_point None
POLYGON geo_shape None
REAL double None
SMALLINT short For UNSIGNED SMALLINT columns in MySQL, we recommend that you use the INTEGER type in Elasticsearch.
TIME date The DATE format is HH:mm:ss, in UTC time. A DATE field accurateprecise to the microsecond is notated in the format of HH:mm:ss.S. For more information, see Date format mappings.
TIMESTAMP date The DATE format is yyyy-MM-dd'T'HH:mm:ss, in UTC time. A DATE field accurate to the microsecond is in the format of yyyy-MM-dd'T'HH:mm:ss.S. For more information, see Date format mappings.
TINYINT short For UNSIGNED TINYINT columns in MySQL, we recommend that you use the INTEGER type in Elasticsearch.
TINYTEXT text None
VARCHAR text None
YEAR date The target DATE format is yyyy, in UTC time. For more information, see Date format mappings.
Note To map a MySQL column to an Elasticsearch field using a data type different from the default data type, you must skip the initial schema synchronization and create the fields with the desired data types in Elasticsearch before you create a data synchronization task