hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject svn commit: r1524258 - /hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh
Date Tue, 17 Sep 2013 23:58:55 GMT
Author: thejas
Date: Tue Sep 17 23:58:54 2013
New Revision: 1524258

URL: http://svn.apache.org/r1524258
Log:
HIVE-5167: webhcat_config.sh checks for env variables being set before sourcing webhcat-env.sh
(Thejas M Nair via Daniel Dai, Thejas Nair)

Modified:
    hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh

Modified: hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh?rev=1524258&r1=1524257&r2=1524258&view=diff
==============================================================================
--- hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh (original)
+++ hive/branches/branch-0.12/hcatalog/webhcat/svr/src/main/bin/webhcat_config.sh Tue Sep
17 23:58:54 2013
@@ -77,29 +77,40 @@ else
 fi
 WEBHCAT_CONF_DIR="${WEBHCAT_CONF_DIR:-$DEFAULT_CONF_DIR}"
 
+#users can add various env vars to webhcat-env.sh in the conf
+#rather than having to export them before running the command
+if [ -f "${WEBHCAT_CONF_DIR}/webhcat-env.sh" ]; then
+  source "${WEBHCAT_CONF_DIR}/webhcat-env.sh"
+fi
+
 #set defaults for HCAT_PREFIX, HIVE_HOME, TEMPLETON_HOME that work for default directory
structure
 DEFAULT_HCAT_PREFIX="${WEBHCAT_PREFIX}"
 export HCAT_PREFIX="${HCAT_PREFIX:-$DEFAULT_HCAT_PREFIX}"
 if [ ! -f ${HCAT_PREFIX}/bin/hcat ]; then
     die "HCAT_PREFIX=${HCAT_PREFIX} is invalid";
 fi
+
+#hcat script can sometimes determine HIVE_HOME itslef
+#so HIVE_HOME does not need to be always set at this point
 DEFAULT_HIVE_HOME="${WEBHCAT_PREFIX}/.."
-export HIVE_HOME="${HIVE_HOME:-$DEFAULT_HIVE_HOME}"
-if [ ! -f ${HIVE_HOME}/bin/hive ]; then
-    die "HIVE_HOME=${HIVE_HOME} is invalid";
+if [ -n "$HIVE_HOME" ]; then
+    echo "Lenght of string is non zero"
+    if  [ ! -f ${HIVE_HOME}/bin/hive ]; then
+        die "HIVE_HOME=${HIVE_HOME} is invalid";
+    fi
+elif [ -f ${DEFAULT_HIVE_HOME}/bin/hive ]; then
+    export HIVE_HOME="${HIVE_HOME:-$DEFAULT_HIVE_HOME}"
+    echo "Setting HIVE_HOME $HIVE_HOME"
 fi
+
+
+
 DEFAULT_TEMPLETON_HOME="${WEBHCAT_PREFIX}"
 export TEMPLETON_HOME="${TEMPLETON_HOME:-$DEFAULT_TEMPLETON_HOME}"
 if [ ! -d ${TEMPLETON_HOME}/share/webhcat ]; then
     die "TEMPLETON_HOME=${TEMPLETON_HOME} is invalid";
 fi
 
-#users can add various env vars to webhcat-env.sh in the conf
-#rather than having to export them before running the command
-if [ -f "${WEBHCAT_CONF_DIR}/webhcat-env.sh" ]; then
-  source "${WEBHCAT_CONF_DIR}/webhcat-env.sh"
-fi
-
 #====================================
 #determine where hadoop is
 #====================================



Mime
View raw message