创建表失败
- hive创建表失败,报错
FAILED: Execution Error,
return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
MetaException(message:For direct MetaStore DB
connections, we don’t support retries at the client
level.)
错误信息很不明确,解决思路:
找日志
日志目录:$HIVE_HOME/conf/hive-log4j.properties.template
日志目录配置是由1. hive.log.dir=${java.io.tmpdir}/${user.name}
配置
查看日志
ERROR [main]: Datastore.Schema (Log4JLogger.java:error(115)) - 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
这个错误是字符集问题
*解决方法
更改hive元数据库字符类型
alter database basic01 character set latin1;
use basic01;
alter table PARTITIONS convert to character set latin1;
alter table PARTITION_KEYS convert to character set latin1;
来自@若泽大数据