Hive基本数据类型

2016-07-19  本文已影响169人  zhangxu0636

基本数据类型

复杂数据类型

John Doe^A100000.0^AMary Smith^BTodd Jones^AFederal Taxes^C.2^BStateTaxes^C.05^BInsurance^C.1^A1 Michigan Ave.^BChicago^BIL^B60600

CREATE TABLE employees(
name  STRING,
salary FLOAT,
subordinates ARRAY<STRING>,
deductions MAP<STRING,FLOAT>,
address STRUCT<street:STRING,city:STRING,state:STRING,zip:INT>
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001' #分隔列
COLLECTION ITEMS TERMINATED BY '\002' #分隔成 array
MAP KEYS TERMINATED BY '\003' #分隔成map
LINES TERMINATED BY '\N'
STORED AS TEXTFILE;  

\001 -> ^A
\002 -> ^B
\003 -> ^C

上一篇 下一篇

猜你喜欢

热点阅读