Hive 問題彙總

1 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT…

當啓動Hive的時候報錯:java

Caused by: javax.jdo.JDOException: Couldnt obtain a new sequence (unique id) : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
NestedThrowables:
java.sql.SQLException: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

這個問題是因爲hive的元數據存儲MySQL配置不當引發的,能夠這樣解決:node

mysql> set global binlog_format='MIXED';

2 For direct MetaStore DB connections, we don’t support retries at the client level.

當在Hive中建立表的時候報錯:mysql

create table years (year string, event string) row format delimited fields terminated by '\t';
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.)

這是因爲字符集的問題,須要配置MySQL的字符集:sql

mysql> alter database hive character set latin1;

3 HiveConf of name hive.metastore.local does not exist

當執行Hive客戶端時候出現以下錯誤:apache

WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist

這是因爲在0.10 0.11或者以後的HIVE版本 hive.metastore.local 屬性再也不使用。將該參數從hive-site.xml刪除便可。oop

4 Permission denied: user=anonymous, access=EXECUTE, inode=」/tmp」

在啓動Hive報以下錯誤:code

(Permission denied: user=anonymous, access=EXECUTE, inode="/tmp":hadoop:supergroup:drwx------

這是因爲Hive沒有hdfs:/tmp目錄的權限,賦權限便可:orm

hadoop dfs -chmod -R 777 /tmp

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

Hive> CREATE TABLE dummy(value STRING);

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

解決方法:xml

mysql > alter database hive character set latin1;

6 未完待續

相關文章
相關標籤/搜索