Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

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.

Getting error while executing hive merge

avatar

I am running below query:

MERGE INTO college_for_mrg AS T USING college AS S ON clg_name = clg_name WHEN MATCHED AND clg_id > 5 THEN UPDATE SET clg_loc = "ind" WHEN NOT MATCHED THEN INSERT VALUES(2,"sd","dsd","dsfs");

Both the tables support acid properties.

i have also tried table name as database_name.table_name in query but still its giving same error.

error: FAILED: ParseException line 3:0 cannot recognize input near 'MERGE' 'INTO' 'college_for_mrg'

please help.

1 ACCEPTED SOLUTION

avatar
Master Mentor

are you running merge command on HDP? It is not supported in any of the current releases. You need Apache Hive 2.2 for merge functionality. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Merge

View solution in original post

1 REPLY 1

avatar
Master Mentor

are you running merge command on HDP? It is not supported in any of the current releases. You need Apache Hive 2.2 for merge functionality. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Merge