What is the correct location for Java – hive-jdbc-__-standalone.jar?

What is the correct location for Java – hive-jdbc-__-standalone.jar? … here is a solution to the problem.

What is the correct location for Java – hive-jdbc-__-standalone.jar?

Guidelines for setting up Hive 0.14:
http://www.ishaanguliani.com/content/hive-0140-setup-ubuntu

Hint if an error occurs:

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-0.14.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.

The file hive-jdbc-0.14.0-standalone.jar must be moved out of $HIVE_HOME/lib/

But when I run beeline, it gets an error because the file doesn’t exist:

$ $HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000
ls: cannot access /usr/local/hive/lib/hive-jdbc-*-standalone.jar: No such file or directory

What is the right thing to do?

Solution

You can do any of the following

RCA: In hive2.1, the hive-jdbc-*-standalone.jar file does not exist in ${HIVE_LIB}, but in the {$HIVE_HOME}/jdbc directory.

** System Specification **
Hive-2.1 binary
java1.8
CentOS Linux version 7.1.1503 (core edition).

Possible solution:

  1. Copy the jar file to the directory required by the script.
    It’s simple, but I don’t like to keep multiple files

    bash# cp ${HIVE_HOME}/jdbc/hive-jdbc-2.1.0-standalone.jar ${HIVE_HOME}/lib/hive-jdbc-2.1.0-standalone.jar

or

  1. Create a link to the jar file to point to the directory required by the
    script
    (my preferred method).
    bash# ln -s ${HIVE_HOME}/jdbc/hive-jdbc-2.1.0-standalone.jar ${HIVE_HOME}/lib/hive-jdbc-2.1.0-standalone.jar

  2. Edit the file ${HIVE_HOME}/bin/ext/beeline.sh

    bash# vi +27 ${HIVE_HOME}/bin/ext/beeline.sh

Edit the row

jdbcStandaloneJarPath=`ls ${HIVE_LIB}/hive-jdbc-*-standalone.jar`

to

jdbcStandaloneJarPath=`ls ${HIVE_HOME}/jdbc/hive-jdbc-*-standalone.jar`

Related Problems and Solutions