hive 关于array的常用操作。[排序][包含]

来源:互联网 发布:网络教育本科含金量 编辑:程序博客网 时间:2024/05/16 12:22
select  count(*)   from  xxxxxxxx   
    > lateral view  explode(pair) ids_table1  as id1   lateral view  explode(pair) ids_table2  as id2 

    >  where  year=2016 and  month =2 and day =23  and id2.type=68 and id1.type=68  and  sort_array(dates)[0]='20160223' limit 3;





select  count(*)   from  xx
lateral view  explode(pair) ids_table1  as id1   lateral view  explode(pair) ids_table2  as id2  
where  year='2016' and month='02'  and day='23' and id2.type=68 and id1.type=64  and array_contains(dates,'20160223'); 
 



0 0