Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting error while executing hive merge

Solved Go to solution
Highlighted

Getting error while executing hive merge

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

Accepted Solutions

Re: Getting error while executing hive merge

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

Re: Getting error while executing hive merge

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

Don't have an account?
Coming from Hortonworks? Activate your account here