Pit that Hive stepped on during use

Keywords: Big Data hive Java Hadoop MySQL

Error 1 when hive starts

Cannot execute statement:impossible to write to binary long since BINLOG_FORMAT = STATEMENT...
//Error when starting
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-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITED.
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 COMMITED or READ UNCOMMITED.
Cause: This is caused by improper configuration of hive's metadata storage MYSQL

Solution 1 (temporary solution): MySQL > set global binlog? Format ='mixed '

Solution 2 (permanent solution):
Modify / etc/my.cnf to add attributes
# binary logging format - mixed recommended 
binlog_format=mixed

Error 2 when hive starts

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:230)
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
	at org.apache.hadoop.hive.cli.CliDriver.setupConsoleReader(CliDriver.java:787)
	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:721)
	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Reason:
There is an old version of jline in the hadoop Directory:
/hadoop-2.7.2/share/hadoop/yarn/lib: 
-rw-r--r-- 1 root root   87325 Mar 10 18:10 jline-0.9.94.jar

Solve:
Copy the jline version number. jar file under the Lib directory of the hive installation path to the hadoop installation directory / share/hadoop/yarn/lib.
For example: cp-r / hive / lib / jline-2.12.jar / hadoop-2.7.2/share/hadoop/yarn/lib

Appears when hive creates a table

Error: Error while processing statement: 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.) (state=08S01,code=1). 
Reason: the character set used when creating mysql is incorrect. You need to modify the character set of hive database.
Solution: modify the character set of hive database with the command in mysql: alter database hive character set latin1;

Stuck in drop table

Cause: the character set of hive database created first and modified later is stuck.
Solve:
1. Enter mysql, delete hive, the metabase created under mysql, and then recreate it with MySQL. After creation, modify the character set to latin1. When MySQL deletes hive, you need to stop hive, otherwise MySQL will also be stuck.
2. You can also modify the / etc/my.cnf file to set the attributes of characters involved in it to latin1.

Welcome to the public address below to get more articles.

Posted by FortMyersDrew on Mon, 28 Oct 2019 14:17:31 -0700