执行语句如下

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

错误提示如下

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

 

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

解决方案:

1.改个名字就好

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

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

 

相关文章:

  • 2021-06-09
  • 2021-08-08
  • 2021-07-13
  • 2021-11-24
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-13
  • 2022-12-23
  • 2021-11-19
  • 2021-06-17
  • 2021-12-04
  • 2021-07-22
  • 2021-05-26
相关资源
相似解决方案