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