Hive实现切分后数组内排序
select
distinct cust
,sku
,c2
,case
when length(c1) <= 9 then replace(c1,',','')
--取最小
when length(c1) > 9 then sort_array(split(c1,','))[0]
--取最大
when length(c1) > 9 then -sort_array(-split(c1,','))[0]
end as c1
from table
where ds = '${bdp.system.bizdate}'
--and length(c1) > 8
and nvl(sku,'') <> ''