2017-10-11 80 views
0

以下HQL在HDP 2.6.1上生成錯誤& Hive 1.2.1000。它是直線問題還是Hive版本?配置單元和主鍵約束

CREATE EXTERNAL TABLE IF NOT EXISTS `nwdb.strings` (`string_id` INT, `string_data` STRING, PRIMARY KEY(string_id) DISABLE NOVALIDATE) ROW FORMAT DELIMITED FIELDS TERMINATED BY "," LINES TERMINATED BY "\n" STORED AS TEXTFILE LOCATION "/data/nwdb/"; 

錯誤

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`); 

回答