「hive」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