我熟悉SQl,但不熟悉Hive,因此我需要更改以下代码部分的exist部分。
df_tic = hiveContext.sql("""select distinct oe.*, o.*, so.*
from
BOE oe join MSO o on oe.ms_order_id = o.ms_order_id
join SUBO so on so.ms_order_id = o.ms_order_id
join JOB j on j.entity_id = so.ms_sub_order_id
join TASK t on t.wf_job_id = j.wf_job_id
and o.order_type = 900
and o.entered_date between date_sub(current_date(),3)
and date_sub(current_date(),2)
and j.entity_type = 5
and exists -- failure
( select 'X'
from TASK t
and ((t.name like '%Error%') or (t.name like '%Correct%') or (t.name = '%Create%'))
on t.wf_job_id = j.wf_job_id )
order by o.USRP
""")
我在存在部分中得到了错误(按预期)。有人可以帮我更新存在的部分,以便它可以工作吗?