Specified key was too long; max key length is 767 bytes

在Hive里创建表时出现了错误:

FAILED: Execution Error, return code 1 from org.apache.Hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes
com.MySQL.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

解决的办法是把数据库的Character Set改成latin1:

mysql > alter database hive character set latin1;

 

posted @ 2017-03-18 14:41  MSTK  阅读(352)  评论(0编辑  收藏  举报