Hive 相关问题疑难杂症汇总

2020-10-27  本文已影响0人  青玉_f18c

1.创建Hive表失败

1.1问题描述

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.)

1.2 解决方案

查看Hive日志,看到这样的错误日志:

NestedThrowablesStackTrace:
Could not create "increment"/"table" value-generation container SEQUENCE_TABLE since autoCreate flags do not allow it.
org.datanucleus.exceptions.NucleusUserException: Could not create "increment"/"table" value-generation container SEQUENCE_TABLE since autoCreate flags do not allow it.
出现上述问题主要因为mysql的bin-log format默认为statement ,在mysql中通过 show variables like 'binlog_format'; 语句查看bin-log format的配置值

mysql> show variables like 'binlog_format';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
修改bin-log format的默认值,在mysql的配置文件/etc/mysql/mysql.conf.d/mysqld.cnf中添加 binlog_format="MIXED" ,重启mysql,再启动 hive即可。

mysql> show variables like 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | MIXED |
+---------------+-------+
1 row in set (0.00 sec)
再次执行创表语句.

2. Java连接Hive 驱动失败

2.1问题描述

java.lang.ClassNotFoundException: org.apache.hadoop.hive.jdbc.HiveDriver

2.2解决方案

private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
取代
private static String driverName = "org.apache.hive.jdbc.HiveDriver"

上一篇下一篇

猜你喜欢

热点阅读