「hive」explode拆分

本文通过一个具体的SQL查询案例,展示了如何使用lateral view explode对数组字段进行拆分,并针对特定条件进行数据筛选,对比了不同查询条件下的数据差异。

说明:idlist字段为数组,值为 [{"idtype":15,"id":"f4:70:ab:85:b3:6a"},{"idtype":13,"id":"864552030217876"},{"idtype":17,"id":"88d3dddf16f41b0b"},{"idtype":19,"id":"89860057141491075795"}]


select count(*) from app_boot_attr lateral view explode(idlist) t as tt where tt.idtype = 13 and year='2017' and month='11' and day<='15' and day >='09';
2042214

select count(*) from app_boot_attr where year='2017' and month='11' and day<='15' and day >='09';
2058818

转载于:https://www.cnblogs.com/ftrako/p/7844126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值