如何在雅典娜中加入非最重要的功能?
我在雅典娜上有此查询。
trip.id as tripid
, segment.id as segmentid
, segment.distance as mileage
, segment.maxspeed as maxspeed
, segment.duration as duration
, segment.roadtype as roadtype
, segment.timeslotdata as timeslots
, extract( week from (from_unixtime(trip.referencedate /1000))) as weekyear
, extract( year from (from_unixtime(trip.referencedate /1000))) as year
, extract( month from (from_unixtime(trip.referencedate/1000))) as month
, unn.firstpositionlat
, unn.firstpositionlong
from
trip
, UNNEST(segments) as t(segment)
left join
(
select
position.latitude as firstpositionlat
, position.longitude as firstpositionlong
, position.id as id
from
trip
, UNNEST(segments) as t(segment)
, UNNEST(segment.positions) as t(position)
where
anno = 2021
and mese = 01
and giorno = 01
and tscid = 'XXX'
)
unn
on
segment.startpositionid = unn.id
where
anno = 2021
and mese = 01
and giorno = 01
and tscid = 'XXX'
问题是我无法加入第16:19行上的错误,并且我有此错误
stytax_error:line 16:19:列“段”无法解析
我无法弄清楚问题在哪里。 如果没有 语句,则效果很好。
先感谢您
i have this query on Athena
trip.id as tripid
, segment.id as segmentid
, segment.distance as mileage
, segment.maxspeed as maxspeed
, segment.duration as duration
, segment.roadtype as roadtype
, segment.timeslotdata as timeslots
, extract( week from (from_unixtime(trip.referencedate /1000))) as weekyear
, extract( year from (from_unixtime(trip.referencedate /1000))) as year
, extract( month from (from_unixtime(trip.referencedate/1000))) as month
, unn.firstpositionlat
, unn.firstpositionlong
from
trip
, UNNEST(segments) as t(segment)
left join
(
select
position.latitude as firstpositionlat
, position.longitude as firstpositionlong
, position.id as id
from
trip
, UNNEST(segments) as t(segment)
, UNNEST(segment.positions) as t(position)
where
anno = 2021
and mese = 01
and giorno = 01
and tscid = 'XXX'
)
unn
on
segment.startpositionid = unn.id
where
anno = 2021
and mese = 01
and giorno = 01
and tscid = 'XXX'
the problem is that i can't join because of an error on line 16:19, and i have this error
SYNTAX_ERROR: line 16:19: Column 'segments' cannot be resolved
i can't figure out where the problem is.
Without the ON statement, this works well.
thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
presto(雅典娜的基础SQL引擎)支持仅在
交叉加入
的右侧。例如:输出:
猫 似乎速记符号(
trip,unnest(semgments)作为t(semgment)
)无法正常工作,然后再加入条件,请尝试将其展开到完整形式:Presto (underlying SQL engine for Athena) supports
UNNEST
only on the right side ofCROSS JOIN
. For example:Output:
It seems that shorthand notation (
from trip, UNNEST(segments) as t(segment)
) is not working correctly when followed by another join withon
condition, try to just expand it to the full form: