Created 08-30-2018 11:35 AM
Hi,
I am using HDP 2.5 in hortonworks sanbox. The HIVE version is 1.2.1. I am trying to create hive table with primary key constraint with below query:
CREATE TABLE pk (id1 int,id2 int, name string, dept string, primary key(id1,id2) disable novalidate) PARTITIONED BY (year string);
while executing this create table query it throws below error:
ParseException line 1:65 cannot recognize input near 'key' '(' 'id1' in column type
I am not getting what this error and how to resolve it.
Is constraints supported in HIVE 1.2.1 ?
can anyone help me out to resolve this issue ?
Thank You.
Created 08-30-2018 01:20 PM
Based on this jira
https://issues.apache.org/jira/browse/HIVE-13290
and the hive docs:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Constraints
This is supported from hive 2.1.0 onwards only.
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 08-30-2018 01:20 PM
Based on this jira
https://issues.apache.org/jira/browse/HIVE-13290
and the hive docs:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Constraints
This is supported from hive 2.1.0 onwards only.
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created 08-31-2018 06:50 AM
Thank you.