Openflow Connector for MySQL: Data mapping

Note

This connector is subject to the Snowflake Connector Terms.

This topic describes MySQL data types are mapped to Snowflake data types.

MySQL 到 Snowflake 数据类型的映射

下表显示了在复制数据时,MySQL 数据类型如何映射到 Snowflake 数据类型。

MySQL typeSnowflake typeNotes
DECIMAL / NUMERICNUMBERThe maximum number of digits in DECIMAL format for MySQL is 65. For Snowflake, the maximum is 38. Precision is lost when exceeded.
INT / INTEGERINT
TINYINT / BOOLINT
SMALLINTINT
MEDIUMINTINT
BIGINTINT
YEARINT
FLOATFLOAT
DOUBLEFLOAT
VARCHARTEXT
CHARTEXTTrailing spaces aren’t preserved.
TINYTEXTTEXT
TEXTTEXT
MEDIUMTEXTTEXTSupported up to the maximum entry size in Snowflake (16 MB).
LONGTEXTTEXTSupported up to the maximum entry size in Snowflake (16 MB).
ENUMTEXTStored as a string value. For example, for ENUM('one', 'two') the possible values are 'one' and 'two'.
SETTEXTStored as a comma-separated string in column declaration order. For example, for SET('one', 'two') the possible values are '', 'one', 'two', and 'one,two'.
BITTEXTRepresented as a hexadecimal string. For example: '83060c183060c183'.
DATEDATE
DATETIMETIMESTAMP_NTZ
TIMESTAMPTIMESTAMP_TZValues are stored in UTC.
TIMETIME
BINARYBINARY
VARBINARYBINARY
TINYBLOBBINARY
BLOBBINARY
MEDIUMBLOBBINARYSupported up to the maximum entry size in Snowflake (16 MB).
LONGBLOBBINARYSupported up to the maximum entry size in Snowflake (16 MB).
JSONVARIANTSupported up to the maximum entry size in Snowflake (16 MB).

Note

本表中未列出的任意 MySQL 数据类型默认映射到 TEXT。