Support Questions

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

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