启动hive客户端对数据库进行操作时常有的错误

参考之前的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

来排错!

猜你喜欢

转载自blog.csdn.net/grit_icpc/article/details/73695144