hive里因为列名用了关键字导致建表失败

代码

hive里因为列名用了关键字导致建表失败_第1张图片

现象

hive里因为列名用了关键字导致建表失败_第2张图片

ParseException line 6:4 cannot recognize input near 'percent' 'String' 'COMMENT' in column name or primary key or foreign key
23/11/13 11:52:57 ERROR org.apache.hadoop.hive.ql.Driver: FAILED: ParseException line 6:4 cannot recognize input near 'percent' 'String' 'COMMENT' in column name or primary key or foreign key
org.apache.hadoop.hive.ql.parse.ParseException: line 6:4 cannot recognize input near 'percent' 'String' 'COMMENT' in column name or primary key or foreign key

原因

在hive中row和percent都是关键字,所以会报错

更改后的代码

hive里因为列名用了关键字导致建表失败_第3张图片

你可能感兴趣的:(一些小坑,大数据,hive,hadoop,数据仓库)