commit 18ddceee8f6666b83dcd3a5e2c7641057bfc4b23 Author: Janaki Lahorani Date: Wed Jan 17 11:19:56 2018 -0800 HIVE-18472: Resolve Log4j warnings Change-Id: I43dd2255c65e49b67ba2243d362d0968bce27ce5 diff --git bin/hive bin/hive index 4a908e1e428dfe36a2956316fc023e784e870875..7c7949793a4b0f98914e836ee46498602240ea8a 100755 --- bin/hive +++ bin/hive @@ -131,8 +131,15 @@ if [ ! -f ${HIVE_LIB}/hive-cli-*.jar ]; then exit 3; fi +# Hbase and Hadoop use their own log4j jars. don't include those now +LOG_JAR_CLASSPATH=""; + for f in ${HIVE_LIB}/*.jar; do - CLASSPATH=${CLASSPATH}:$f; + if [[ $f == *"log4j"* ]]; then + LOG_JAR_CLASSPATH=${LOG_JAR_CLASSPATH}:$f; + else + CLASSPATH=${CLASSPATH}:$f; + fi done # add the auxillary jars such as serdes @@ -340,6 +347,9 @@ if [[ "$SERVICE" =~ ^(hiveserver2|beeline|cli)$ ]] ; then fi fi +# include the log4j jar that is used for hive into the classpath +export CLASSPATH="${CLASSPATH}:${LOG_JAR_CLASSPATH}" + if [ "$TORUN" = "" ] ; then echo "Service $SERVICE not found" echo "Available Services: $SERVICE_LIST"