From a5209e64b938582a51015f600cd2d844b70af9d3 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Tue, 23 Apr 2013 10:16:37 -0700 Subject: [PATCH] HIVE-2055 include hbase dependencies in launch script Look for HBase and dependencies. If available, include them in the launch classpath. --- bin/hive | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/hive b/bin/hive index 0b64877..531a96f 100755 --- a/bin/hive +++ b/bin/hive @@ -153,6 +153,21 @@ export HADOOP_HOME_WARN_SUPPRESS=true # pass classpath to hadoop export HADOOP_CLASSPATH="${HADOOP_CLASSPATH}:${CLASSPATH}" +# set HBASE_HOME to bigtop rpm install prefix or +# use HBASE_HOME defined in the environment +HBASE_HOME=${HBASE_HOME:-"/usr/lib/hbase"} +HBASE_CONF_DIR=${HBASE_CONF_DIR:-"${HBASE_HOME}/conf"} + +if [ -d ${HBASE_HOME} ] ; then + for jar in $(find $HBASE_HOME -name *.jar -not -name thrift\*.jar); do + HBASE_CLASSPATH=$HBASE_CLASSPATH:${jar} + done + export HADOOP_CLASSPATH="${HADOOP_CLASSPATH}:${HBASE_CLASSPATH}" +fi +if [ -d $HBASE_CONF_DIR ] ; then + HADOOP_CLASSPATH="${HADOOP_CLASSPATH}:${HBASE_CONF_DIR}" +fi + # check for hadoop in the path HADOOP_IN_PATH=`which hadoop 2>/dev/null` if [ -f ${HADOOP_IN_PATH} ]; then -- 1.8.1