Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to update Hive row with JOIN

avatar

I want to port the following SQL statement to Hive from Sybase. What is the best approach to get the below to work in Hive? Hive DML UPDATE syntax doesn't mention support for JOINs or nested SELECT statements.

UPDATE table1 
 SET table1.column1 = table2.column1,
     table1.column10 = table2.column10
 FROM table1, table2
 WHERE table1.columnID = table2.columnID

After enabling transactional=true on table1 the above produces an error:

Error while compiling statement: FAILED: ParseException ... missing EOF at 'FROM' ...
1 ACCEPTED SOLUTION

avatar
Super Collaborator

This not supported and there is no efficient way to do this. This will be handled once support for MERGE statement is added

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

This not supported and there is no efficient way to do this. This will be handled once support for MERGE statement is added

avatar

Thanks. I'll watch this JIRA for progress: https://issues.apache.org/jira/browse/HIVE-10924