数据类型 | Hive | SQL Server | MySQL | PostgreSQL |
---|---|---|---|---|
数值类 | bigint | bigint | bigint | bigint |
tinyint | tinyint | tinyint | * | |
smallint | smallint | smallint | smallint | |
int | int | int | int | |
float/double | float | float/double | real/double precision | |
decimal | decimal/numeric | decimal | numeric | |
布尔类 | boolean | bit | tinyint(1) | boolean |
字符类 | string | nvarchar | varchar | character varying(varchar) |
string | char | char | character(char) | |
string | text | text | text | |
日期类 | date | date | date | date |
timestamp | datetime | datetime | timestamp |
参考资料
- https://docs.oracle.com/goldengate/v12212/gg-veridata/GVDUG/column-mapping.htm#GVDUG-GUID-300B4B64-104D-473A-81AB-F2224B021C13
- https://docs.informatica.com/data-replication/data-replication/9-7-0/datatype-mapping-reference/datatype-mappings-for-microsoft-sql-server-sources/microsoft-sql-server-source-and-hive-target.html
- https://www.postgresql.org/docs/8.1/datatype.html
- https://cwiki.apache.org/confluence/display/hive/languagemanual+types
- https://dev.mysql.com/doc/workbench/en/wb-migration-database-mssql-typemapping.html