sparksql Error in query: resolved attribute(s)报错分析
项目场景:
sparksql Error in query: resolved attribute(s) XX#4245L missing from XX#4520,XX#684L 错误
问题描述:
提示:spark实际生产环境中 使用sparksql进行同表关联时 报错代码如下
select
distinct a.imsi
from (
select imsi,ho_time,longitude,latitude
from (
select imsi,ho_time,longitude,latitude,row_number() over (partition by imsi order by ho_time) as num from tmp_highrail_users
)s
where s.num=1
) a left join
(
select imsi,ho_time,longitude,latitude
from (
select imsi,ho_time,longitude,latitude,row_number() over (partition by imsi order by ho_time) as num from tmp_highrail_users
)s
where s.num=2
)b
on a.imsi=b.imsi
报错代码
Error in query: resolved attribute(