FAILED: ParseException line mismatched input '<EOF>' expecting StringLiteral near 'by' in

HIVE创建表的时候报错,错误信息如下:

 

MismatchedTokenException(-1!=282)
        at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
        at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
        at org.apache.hadoop.hive.ql.parse.HiveParser.tableRowFormatFieldIdentifier(HiveParser.java:23260)
        at org.apache.hadoop.hive.ql.parse.HiveParser.rowFormatDelimited(HiveParser.java:22272)
        at org.apache.hadoop.hive.ql.parse.HiveParser.tableRowFormat(HiveParser.java:22500)
        at org.apache.hadoop.hive.ql.parse.HiveParser.createTableStatement(HiveParser.java:4329)
        at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:1987)
        at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1273)
        at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:928)
        at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:190)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:418)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:902)
        at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
FAILED: ParseException line 32:75 mismatched input '<EOF>' expecting StringLiteral near 'by' in table row format's field separator

 

主要原因是 定义字段分割符的时候 用了";" 因为hdfs文件的的格式就是用分号隔开的。

 

解决办法:

找到分号的asc码值 : http://blog.csdn.net/lxpbs8851/article/details/11525501

(其他字符有同样问题 也可以这样做)  找到的是073  那么将定义表的语句修改为:

 row format delimited fields terminated by '\073'    。

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值