Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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