Hive建表语句出现错误ParseException line 1:28 cannot recognize input near 'time' 'string' ',' in column name or constraint


create table if not exists hive.data(ip string,time string,day string,traffic bigint,type string,id string);

 

在hive中建表时会出现这样的问题,纠结了很久,网上查询说time字段为hive保留字段,修改之后即可。如果非要用这个字段名,就用反引号改起来:

反引号就是键盘左上方1的左边那个,中文的符号` 

如create table if not exists hive.data(ip string,`time` string,day string,traffic bigint,type string,id string);

 

 

 

 

引用https://blog.csdn.net/u011940366/article/details/51396152

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM