因爲要實現多人開發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元數據庫的字符集,問題就可以解決!