使用kettle创建hive表时,出现的错误信息:
Error while compiling statement: FAILED: ParseException line 1:47 cannot recognize input near ‘date’ ‘TIMESTAMP’ ‘)’ in column name or constraint
创表语句
CREATE TABLE mysql2hive
(id DOUBLE
,uname STRING
,date TIMESTAMP);
解决方案:这个实际上是因为hive中的保留关键字引起的,例如我这里的date。
修改方法只需要在date加上反引号date
即可。反引号:`
(英文模式下,数字1左边的就是反引号)
CREATE TABLE mysql2hive
(id DOUBLE
,uname STRING
,`date` TIMESTAMP);
参考:
https://stackoverflow.com/questions/18640760/hive-parseexception-cannot-recognize-input-near-end-string