028.hive-sort_arry实现字段横向比较,并取出最大值

 

hive-sort_arry实现字段横向比较,并取出最大值

 

先把多字段组成数组,再数组排序,取出最后一个即为最大值
sort_array(array(nvl(is_receive_recharge,
0),nvl(is_receive_coupon,0),nvl(is_receive_points,0),nvl(mess_tag,0)))[3]

 

posted @ 2022-03-11 18:50  star521  阅读(471)  评论(0编辑  收藏  举报