文章适合新手了解Hive 建表关键字详解。文章在编写过程中难免有疏漏和错误,欢迎大佬指出文章的不足之处;更多内容请点进👉 Lino_White 👈查看。
未来的世界充满着各式各样的数据,我们该怎么好好利用起来呢?开启正文吧~~~
Hive添加Array数组字段以及数据录入
Create table a(id int,hobby array< string >) row format delimited fileds terminated by ‘,’ collection items terminated by ‘,’
collection items terminated by ‘,’:数组成员之间的间隔符使用逗号 [“A”,”B”,”C”]
Hive添加Map类型字段以及数据录入
Create table a(scores map<string,int>) collection items terminated by ‘,’ map keys terminated by ‘:’;
collection items terminated by ‘,’ :键值集合成员之间的间隔符为逗号
map keys terminated by ‘:’:键和值之间的间隔使用冒号 A:90,B:80,D:97
Hive添加Struct集合类型字段以及数据录入
Create table a(info struct<name:string,age:int>) row format delimited fields terminated by ‘\t’ collection items terminated by ‘,’;
collection items terminated by ‘,’;:集合成员之间用逗号隔开