hive的数据类型篇
hive的内置数据类型可分为两大类:
1.基础数据类型
2.复杂数据类型
基础类型有:
tinyint,smallint,int,bigint,boolean,float,double,string,binary,timestamp,decimal,char,varchar,date。
数据类型表
归属类型 | 数据类型 | 数据长度 |
---|---|---|
Numeric Types(数字类型) | tinyint | 1byte,-128~127 |
Numeric Types(数字类型) | smallint | 2byte,-32768~32767 |
Numeric Types(数字类型) | int/integer | 4byte,-2147483648 ~ 2147483647 |
Numeric Types(数字类型) | bigint | 8byte,-9223372036854775808 ~ 9223372036854775807 |
Numeric Types(数字类型) | float | 4byte单精度 |
Numeric Types(数字类型) | decimal | 在hive 0.11.0中引入,精度38位。在hive0.13.0中引入了用户自定义精度和规模 |
Numeric Types(数字类型) | numeric | same as decimal |
Numeric Types(数字类型) | double | 8byte单精度 |
Date/Time Types(时间类型) | timestamp | 从hive0.8.0开始使用 |
Date/Time Types(时间类型) | date | 从hive0.12.0开始使用 |
Date/Time Types(时间类型) | interval | 从hive0.12.0开始使用 |
String Types(字符串类型) | string | 从hive0.8.0开始使用 |
String Types(字符串类型) | char | 从Hive0.8.3开始支持 |
String Types( |