Hive字段类型与MySQL/SQL Server/PG的字段类型映射参考

数据类型 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

参考资料

  1. https://docs.oracle.com/goldengate/v12212/gg-veridata/GVDUG/column-mapping.htm#GVDUG-GUID-300B4B64-104D-473A-81AB-F2224B021C13
  2. 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
  3. https://www.postgresql.org/docs/8.1/datatype.html
  4. https://cwiki.apache.org/confluence/display/hive/languagemanual+types
  5. https://dev.mysql.com/doc/workbench/en/wb-migration-database-mssql-typemapping.html

你可能感兴趣的:(大数据,hive,mysql,postgresql)