Set HIVE_AUX_JARS_PATH in the Hive Client’s hive-env.sh File
When you execute the hive command to enter the Hive CLI, the initialization script named hive-env.sh
is executed; which sets the value of the HIVE_AUX_JARS_PATH
environment variable for the Hive CLI. Rather than copying the Oracle NoSQL Database libraries in the manner described in the previous section, an alternative way to make the necessary Oracle NoSQL Database JAR files available to the Hive classpath would be to simply edit hive-env.sh
and add those JAR files to the specification of the HIVE_AUX_JARS_PATH
environment variable. For example,
edit <HIVE_CONF_DIR>/hive-env.sh
if [ -z "$HIVE_AUX_JARS_PATH" ];
then
export HIVE_AUX_JARS_PATH=\
/opt/oracle/kv-ee/lib/kvclient.jar,\
/opt/oracle/kv-ee/lib/kvstore-ee.jar\
/opt/oracle/kv-ee/lib/jackson-core.jar,\
/opt/oracle/kv-ee/lib/\
jackson-databind.jar,\
/opt/oracle/kv-ee/lib/\
jackson-annotations.jar
else
export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH,\
/opt/oracle/kv-ee/lib/kvclient.jar,\
/opt/oracle/kv-ee/lib/kvstore-ee.jar \
/opt/oracle/kv-ee/lib/jackson-core.jar,\
/opt/oracle/kv-ee/lib/\
jackson-databind.jar,\
/opt/oracle/kv-ee/lib/\
jackson-annotations.jar
Note:
Unlike setting a CLASSPATH
environment variable, when setting the HIVE_AUX_JARS_PATH
variable, the separator that is used is a comma, not a colon.