最近,因为工作的需要,一直在研究hadoop系统。许多分析工作都将通过hive来解决,所以特将所碰到的问题和解决方案,陆续整理出来,既做为回顾又供需要的朋友参考! 


   因为要实现多人开发Hive,所以需要将hive的元数据存储在mysql。配置完成后,配置之前hive中创建的数据表在show tables时都不会出现,但hdfs数据文件都还在。

   当在hive中drop table 时如果报以下错时

   FAILED: Error in metadata: javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask


  解决的方法是到mysql中的hive数据库里执行 alter database hive character set latin1;改变hive元数据库的字符集,问题就可以解决!

 

 

 此外,在将hive元数据存储在远程mysql后。发现Hive中的中文都变成乱码,个人认为是java输出文件流的问题。不知道大家有没有碰到这种情况,是如何解决的?

 

posted on 2011-06-29 09:35  Sir.q  阅读(3181)  评论(0编辑  收藏  举报