1、首先把数组打散,生成中间表YYY
select exploded_column,XXXX.column2 from XXXX LATERAL VIEW explode(XXXX.column1) t1 as exploded_column
2、使用first_value获取最小值,last_value获取最大值
代码语言:javascript复制select uid,point_id,
first_value(loc_x)over(partition by uid order by point_id) as start,
last_value(loc_x)over(partition by uid order by point_id rows between unbounded preceding and unbounded following) as end
from YYY;