以下配置单元查询中的where子句无法正常工作
select
e.num as badge
from dbo.events as e
where TO_DATE(e.event_time_utc) > TO_DATE(select event_date from DL_EDGE_LRF_facilities.card_swipes_lastpulldate)
event_time_utc和event_date字段都定义为字符串,event_time_utc的时间戳值为'2017-09-18 20:10:19.000000',event_date只有一个日期值,如'2018-01-25'
当我运行查询时,我收到“无法识别'select
''event_date
''附近的输入错误的错误”,请帮忙
答案 0 :(得分:0)
@ user86683; hive无法识别语法,因为它不允许在不等式条件(>)中进行查询。您可以尝试此查询并告诉我结果。
select e.num as badge
from dbo.events as e, DL_EDGE_LRF_facilities.card_swipes_lastpulldate c
where TO_DATE(e.event_time_utc) > TO_DATE(c.event_date)
您将收到警告,但您可以忽略它,因为event_date表只有一条记录。
Warning: Map Join MAPJOIN[10][bigTable=e] in task 'Map 1' is a cross product
Query ID = xxx_20180201102128_aaabb2235-ee69275cbec1
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_09fdf345)
希望这会有所帮助。感谢。