一、背景
datax内置的enumType数据类型与不同数据库间都有些差异,本文整理出相应的映射关系,在配置自定义json时可以参考做一些类型转换
二、映射
1.Hive
DataX 数据类型Hive表 数据类型LongTINYINT,SMALLINT,INT,BIGINTDoubleFLOAT,DOUBLEStringString,CHAR,VARCHAR,STRUCT,MAP,ARRAY,UNION,BINARYBooleanBOOLEANDateDate,TIMESTAMP
2.HBase
DataX 数据类型HBase 数据类型Longint, short ,longDoublefloat, doubleStringstring,binarystringDatedateBooleanboolean
3.MongoDB
DataX 数据类型MongoDB 数据类型Longint, LongDoubledoubleStringstring, arrayDatedateBooleanbooleanBytesbytes
4.Oracle
DataX 数据类型Oracle 数据类型LongNUMBER,INTEGER,INT,SMALLINTDoubleNUMERIC,DECIMAL,FLOAT,DOUBLE PRECISION,REALStringLONG,CHAR,NCHAR,VARCHAR,VARCHAR2,NVARCHAR2,CLOB,NCLOB,CHARACTER,CHARACTER VARYING,CHAR VARYING,NATIONAL CHARACTER,NATIONAL CHAR,NATIONAL CHARACTER VARYING,NATIONAL CHAR VARYING,NCHAR VARYINGDateTIMESTAMP,DATEBooleanbit, boolBytesBLOB,BFILE,RAW,LONG RAW
5.PostgreSQL
DataX 数据类型PostgreSQL 数据类型Longbigint, bigserial, integer, smallint, serialDoubledouble precision, money, numeric, realStringvarchar, char, text, bit, inet. (jsonb,_varchar,_int需要转成字符串 例如jsonb::varchar)Datedate, time, timestampBooleanboolBytesbytea
6.SqlServer
DataX 数据类型SqlServer 数据类型Longbigint, int, smallint, tinyintDoublefloat, decimal, real, numericStringchar,nchar,ntext,nvarchar,text,varchar,nvarchar(MAX),varchar(MAX)Datedate, datetime, timeBooleanbitBytesbinary,varbinary,varbinary(MAX),timestamp
7.Mysql
DataX 数据类型Mysql 数据类型Longint, tinyint, smallint, mediumint, int, bigint, yearDoublefloat, double, decimalStringvarchar, char, tinytext, text, mediumtext, longtextDatedate, datetime, timestamp, timeBooleanbit, boolBytestinyblob, mediumblob, blob, longblob, varbinary
8.ODPS
DataX 数据类型ODPS 数据类型LongBIGINTDoubleDOUBLEStringSTRINGDateDATETIMEBooleanBoolean
9.OSS
DataX 数据类型OSS 数据类型LongLongDoubleDoubleStringStringBooleanBooleanDateDate
10.OTS
DataX 数据类型OTS 数据类型LongIntegerDoubleDoubleStringStringBooleanBooleanBytesBinary
11. TSDB
DataX 数据类型TSDB 数据类型StringTSDB 数据点序列化字符串,包括 timestamp、metric、tags 和 value
12.ADB PG
DataX 数据类型ADB PG 数据类型Longbigint, bigserial, integer, smallint, serialDoubledouble precision, float, numeric, realStringvarchar, char, textDatedate, time, timestampBooleanbool
13.ADS
DataX 数据类型ADS 数据类型Longint, tinyint, smallint, int, bigintDoublefloat, double, decimalStringvarcharDatedateBooleanbool
14. Cassandra
DataX 数据类型Cassandra 数据类型Longint, tinyint, smallint,varint,bigint,timeDoublefloat, double, decimalStringascii,varchar, text,uuid,timeuuid,duration,list,map,set,tuple,udt,inetDatedate, timestampBooleanboolBytesblob
15.DRDS
DataX 数据类型DRDS 数据类型Longint, tinyint, smallint, mediumint, int, bigintDoublefloat, double, decimalStringvarchar, char, tinytext, text, mediumtext, longtextDatedate, datetime, timestamp, time, yearBooleanbit, boolBytestinyblob, mediumblob, blob, longblob, varbinary
16.Phoenix
DataX 数据类型Phoenix 数据类型StringCHAR, VARCHARBytesBINARY, VARBINARYBoolBOOLEANLongINTEGER, TINYINT, SMALLINT, BIGINTDoubleFLOAT, DECIMAL, DOUBLE,DateDATE, TIME, TIMESTAMP
17.KingbaseES
DataX 数据类型KingbaseES 数据类型Longbigint, bigserial, integer, smallint, serialDoubledouble precision, money, numeric, realStringvarchar, char, text, bit, inetDatedate, time, timestampBooleanboolBytesbytea
版权归原作者 chimchim66 所有, 如有侵权,请联系我们删除。