当hive安装完成后,在hive中执行show table等任何命令,都会报以下错:
[grid@racdb ~]$ hive
Logging initialized using configuration in jar:file:/home/grid/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/grid/hive_job_log_grid_201510181909_1589231771.txt
hive> show tables;
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
(略去 很多java 提示)
解决办法:
是到mysql中的hive数据库里执行 alter database hive character set latin1;
改变hive元数据库的字符集,问题就可以解决!
参考:http://sunjia-704471770-qq-com.iteye.com/blog/1631430
[grid@racdb ~]$ hive
Logging initialized using configuration in jar:file:/home/grid/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/grid/hive_job_log_grid_201510181909_1589231771.txt
hive> show tables;
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
(略去 很多java 提示)
解决办法:
是到mysql中的hive数据库里执行 alter database hive character set latin1;
改变hive元数据库的字符集,问题就可以解决!
参考:http://sunjia-704471770-qq-com.iteye.com/blog/1631430