Hive 问题处理记录

1、引用同志的链接:http://godlovesdog.iteye.com/blog/1897602

 

问题1:Specified key was too long; max key length is 767 bytes

在进入Hive后可以show databases; 但create table, show tables;等命令都报错,如下:

[ihadoop@Master ~]$ cd /home/ihadoop/hadoop/hive-0.11.0
[ihadoop@Master hive-0.11.0]$ bin/hive

Logging initialized using configuration in file:/home/ihadoop/hadoop/hive-0.11.0/conf/hive-log4j.properties
Hive history file=/tmp/ihadoop/hive_job_log_ihadoop_5723@Master.Hadoop_201306251428_1159551556.txt
hive> show tables;
FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.hive.metastore.api.MetaException javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) :Specified key was too long; max key length is 767 bytes
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)......................................
 通过网上查找,发现是数据库字符集问题。只要修改MySQL中Hive元数据库MetaStore的字符集便可。
alter database dbname character set latin1;
问题2:java.io.EOFException: Premature EOF from inputStream
参考此链接地址的文章后发现: MapReduce使用lzo压缩注意
hive>set mapred.output.compression.codec=com.hadoop.compression.lzo.LzopCodec
 改为:
hive>set mapred.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;
 虽然只有一个字符之差,但报错却是实实在在的。
 
问题3:java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B
解决方法:检查所有引用的libthrift-x.x.x.jar,把旧版本的JAR包去掉即解决。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值