0
votes

I am getting an error when executing a select statement in Hive.

Error: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:33 cannot recognize input near '' '' ''

Query Sample: ;with cte1 as ( select * from table1) , cte2 as ( select * from table2) , cte3 as (select * from table3) select * from cte2 join cte3 on cte2.col1 = cte3.col1 join cte1 on cte1.col1 = cte2.col1;

1

1 Answers

0
votes

you are missing the alias reference, add the keywound "as" after your alias like

with cte1 as  ( select * from table1) , cte2 as ( select * from table2) , cte3 as ( select * from table3) select * from cte2 join cte3 on cte2.col1 = cte3.col1 join cte1 on cte1.col1 = cte2.col1

Tested in hive 1.1