我将 Hive 配置为使用 mysql 元存储。它工作正常。
但是,当我尝试删除表格时,会出现如下错误。
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 字符集设置将解决此问题。
我的mysql设置如下
mysql> show variables like '%char%';
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+
8 rows in set (0.02 sec)
我将所有字符集设置从 更改utf8
为latin1
,除了character_set_filesystem
, character_set_system
, character_sets_dir
。
即使这样做,当我尝试删除表时,我仍然会遇到相同的错误。更糟糕的是,每当我创建一个新表时,mysql 字符集设置将被重置为utf-8
.
任何人都可以帮忙吗?