You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/11/30 01:12:27 UTC

[90/91] [abbrv] hive git commit: HIVE-12497: Remove HADOOP_CLIENT_OPTS from hive script (Prasanth Jayachandran reviewed by Gopal V)

HIVE-12497: Remove HADOOP_CLIENT_OPTS from hive script (Prasanth Jayachandran reviewed by Gopal V)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0a96201f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0a96201f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0a96201f

Branch: refs/heads/spark
Commit: 0a96201f268a8cf0efe71d960f8814592d30d756
Parents: 2c0c191
Author: Prasanth Jayachandran <j....@gmail.com>
Authored: Sun Nov 29 16:53:20 2015 -0600
Committer: Prasanth Jayachandran <j....@gmail.com>
Committed: Sun Nov 29 16:53:20 2015 -0600

----------------------------------------------------------------------
 bin/ext/version.sh |  2 +-
 bin/hive           | 23 ++++++++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0a96201f/bin/ext/version.sh
----------------------------------------------------------------------
diff --git a/bin/ext/version.sh b/bin/ext/version.sh
index bb6449d..b6a237b 100644
--- a/bin/ext/version.sh
+++ b/bin/ext/version.sh
@@ -27,7 +27,7 @@ version () {
 
   # hadoop 20 or newer - skip the aux_jars option and hiveconf
   CLASS=org.apache.hive.common.util.HiveVersionInfo
-  exec $HADOOP jar $JAR $CLASS
+  exec $HADOOP jar $JAR $CLASS 2>> ${STDERR}
 }
 
 version_help () {

http://git-wip-us.apache.org/repos/asf/hive/blob/0a96201f/bin/hive
----------------------------------------------------------------------
diff --git a/bin/hive b/bin/hive
index 47d99f7..4818667 100755
--- a/bin/hive
+++ b/bin/hive
@@ -25,6 +25,8 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/hive-config.sh
 
+TMP_USER_DIR="/tmp/${USER}"
+STDERR="${TMP_USER_DIR}/stderr"
 SERVICE=""
 HELP=""
 while [ $# -gt 0 ]; do
@@ -193,18 +195,29 @@ if [ "$HADOOP_HOME" == "" ]; then
   exit 4;
 fi
 
-# to avoid errors from log4j2 automatic configuration loading
-export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.xml "
-
 HADOOP=$HADOOP_HOME/bin/hadoop
 if [ ! -f ${HADOOP} ]; then
   echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or hadoop must be in the path";
   exit 4;
 fi
 
+if [ ! -d ${TMP_USER_DIR} ]; then
+  mkdir -p ${TMP_USER_DIR} 2> /dev/null
+  if [ $? -ne 0 ]; then
+    STDERR="/dev/tty"
+  fi
+fi
+
+if [ "${STDERR}" != "/dev/null" ] && [ ! -f ${STDERR} ]; then
+  touch ${STDERR} 2> /dev/null
+  if [ $? -ne 0 ]; then
+    STDERR="/dev/tty"
+  fi
+fi
+
 # Make sure we're using a compatible version of Hadoop
 if [ "x$HADOOP_VERSION" == "x" ]; then
-    HADOOP_VERSION=$($HADOOP version | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2);
+    HADOOP_VERSION=$($HADOOP version 2>> ${STDERR} | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2);
 fi
 
 # Save the regex to a var to workaround quoting incompatabilities
@@ -253,7 +266,7 @@ HBASE_BIN=${HBASE_BIN:-"$(which hbase)"}
 if [[ -n $HBASE_BIN ]] ; then
   # exclude ZK, PB, and Guava (See HIVE-2055)
   # depends on HBASE-8438 (hbase-0.94.14+, hbase-0.96.1+) for `hbase mapredcp` command
-  for x in $($HBASE_BIN mapredcp | tr ':' '\n') ; do
+  for x in $($HBASE_BIN mapredcp 2>> ${STDERR} | tr ':' '\n') ; do
     if [[ $x == *zookeeper* || $x == *protobuf-java* || $x == *guava* ]] ; then
       continue
     fi