I am running the following query in Impala
select count(id) from (select s_id as id, m_id from hur_e_s_amer
union
select s_id, m_id from hur_e_s_emea
union
select r_id, m_id from hur_e_r_amer
union
select r_id, m_id from hur_e_r_emea
) t1
join (select m_id, d_date from hur_e_c_amer
union
select m_id, d_date from hur_e_c_emea
where d_date between '2018-04-09 00:00:00.0' and '2018-06-08 23:59:59.9'
) t2
on t1.m_id = t2.m_id
and then I am getting the following error
Error while compiling statement: FAILED: ParseException line 3:0 missing ALL at 'select' near '' line 5:0 missing ALL at 'select' near ''
The strange thing is I am sure this query was working correctly before but it now doesnt seem to want to work any more.
Any ideas?