hive 建表报错:ParseException - canno

2019-02-11  本文已影响3人  随时学丫

hive 建表报错:ParseException - cannot recognize input near 'end' 'string'

建表语句为

CREATE EXTERNAL TABLE moveProjects (cid string, end string, category string)
STORED BY 'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler'
TBLPROPERTIES ("dynamodb.table.name" = "Projects","dynamodb.column.mapping" = "cid:cid,end:end,category:category");

报错

NoViableAltException(88@[])at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.identifier(HiveParser_IdentifiersParser.java:9123)at org.apache.hadoop.hive.ql.parse.HiveParser.identifier(HiveParser.java:30750)...more stack trace...FAILED: ParseException line 1:77 cannot recognize input near 'end' 'string' ',' in column specification

end 字段为 hive 保留字段,修改之后即可。如果非要用这个字段名,就用反引号改起来:

CREATE EXTERNAL TABLE moveProjects (cid string, `end` string, category string) STORED BY 'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler'
TBLPROPERTIES ("dynamodb.table.name" = "Projects","dynamodb.column.mapping" = "cid:cid,end:end,category:category");

参考:
https://blog.csdn.net/u011940366/article/details/51396152

上一篇下一篇

猜你喜欢

热点阅读