Hive 运行中报 ParseException XXX Failed rule: 'identifier' in column specification

执行语句如下

 create table wei (
id int,name string,local string 
) partitioned by (mouth string) 
row format delimited fields terminated by '\t';

错误提示如下

 解析异常,冷静分析一下就会发现local 是保留关键字,这里解析器把它认为是关键字,所以报错

解决方案:

1.改个名字就好

2.如果非要用这个名字,可以更改conf/hive-site.xml 文件,取消对保留关键字的支持

<property>
    <name>hive.support.sql11.reserved.keywords</name>
    <value>false</value>
</property>

猜你喜欢

转载自www.cnblogs.com/yangxusun9/p/12391289.html