参考之前的hive测试步骤一一执行。
hive> drop table sansom;
FAILED: Error in metadata: org.apache.thrift.transport.TTransportException
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
如果出现
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.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
或者是
FAILED: Error in metadata: MetaException(message:Got exception: org.apache.thrift.transport.TTransportException null)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
以上错误,主要是在select操作、drop操作时,就会出错。
这样的错误,可以修改hive数据库编码:
mysql> alter database hivedb character set latin1;
然后重启hive metastore和hive server就可以了
mysql数据库的编码目前最好设置为latin1,否则使用hive会出现莫名其妙的问题
如何还是不行,可以使用
DEBUG命令:
hive -hiveconf hive.root.logger=DEBUG,console
来排错!
本文介绍了在使用Hive过程中遇到的元数据异常问题及解决方法。主要问题包括执行DDL任务时出现的错误,如drop操作失败等。文章提供了解决方案,即通过修改Hive数据库的字符集为latin1,并重启hive metastore和hiveserver服务。
658

被折叠的 条评论
为什么被折叠?



