Hive和主键约束

时间:2017-10-11 23:51:34

标签: hive hortonworks-data-platform beeline sqlline

以下HQL在HDP 2.6.1& Hive 1.2.1000。它是直线问题还是Hive版本?

Error: Error while compiling statement: FAILED: ParseException line 1:133 cannot recognize input near 'KEY' '(' 'string_id' in column type (state=42000,code=40000)

错误

ALTER TABLE `aravind_stg_platform_nw_northwind_nwdb.strings` ADD CONSTRAINT string_id_PK PRIMARY KEY (`string_id`);

甚至ALTER命令也会出现相同的错误

vertical-align:baseline

1 个答案:

答案 0 :(得分:1)

似乎对主键和外键的支持来自Hive 2.1

https://issues.apache.org/jira/browse/HIVE-13290