以下 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 命令也会给出相同的错误
ALTER TABLE `aravind_stg_platform_nw_northwind_nwdb.strings` ADD CONSTRAINT string_id_PK PRIMARY KEY (`string_id`);