CREATE TABLE article ( id INT, title STRING, type STRING, data_time INT, source STRING, content STRING, PRIMARY KEY (id))ROW FORMAT DELIMITED FIELDS TERMINATED BY ','TBLPROPERTIES ("constraint"="NOT ENFORCED"); FAILED: SemanticException [Error 10326]: Invalid Constraint syntax ENABLE/ENFORCED feature not supported yet. Please use DISABLE/NOT ENFORCED instead.
时间: 2023-12-01 21:03:36 浏览: 108
basic_string源码
3星 · 编辑精心推荐
这个错误提示是因为在 TBLPROPERTIES 中使用了 "constraint"="NOT ENFORCED" 语法,而 Hive 目前还不支持 "ENABLE/ENFORCED" 特性。你需要将 "NOT ENFORCED" 改为 "DISABLE",即改成 "constraint"="DISABLE". 改完后,创建表的 SQL 语句应该是这样的:
```
CREATE TABLE article (
id INT,
title STRING,
type STRING,
data_time INT,
source STRING,
content STRING,
PRIMARY KEY (id)
) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
TBLPROPERTIES ("constraint"="DISABLE");
```
重新执行这个 SQL 语句,应该就可以正常创建 article 表了。
阅读全文