Hive 建表关键字详解(Array数组、Map、Struct集合)

8 篇文章 0 订阅
2 篇文章 0 订阅

文章适合新手了解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 ‘,’;:集合成员之间用逗号隔开

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值