1.collect_list 多行转一行,有序不去重
数据
select 123 uid,'a' name, int(1) type
from t
union all
select 123 uid,'b' name, int(2) type
from t
union all
select 123 uid,'c' name, int(3) type
from t
union all
select 123 uid,'d' name, int(4) type
from t
union all
select 122 uid,'a' name, int(1) type
from t
union all
select 122 uid,'b' name, int(2) type
from t
union all
select 122 uid,'c' name, int(3) type
from t
union all
select 124 uid,'a' name, int(1) type
from t
union all
select 124 uid,'b' name, int(3) type
from t
表
TEMP t= select uid,name from temp_2019123102 distribute by uid sort by type
OUTPUT sel