You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/10/20 00:44:49 UTC
svn commit: r826850 - in /hadoop/hive/trunk: CHANGES.txt bin/ext/cli.sh
Author: zshao
Date: Mon Oct 19 22:44:48 2009
New Revision: 826850
URL: http://svn.apache.org/viewvc?rev=826850&view=rev
Log:
HIVE-890. Fix cli.sh for detecting Hadoop versions. (Paul Huff via zshao)
Modified:
hadoop/hive/trunk/CHANGES.txt
hadoop/hive/trunk/bin/ext/cli.sh
Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=826850&r1=826849&r2=826850&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Mon Oct 19 22:44:48 2009
@@ -196,6 +196,9 @@
HIVE-884. Metastore Server should call System.exit() on error.
(Zheng Shao via pchakka)
+ HIVE-890. Fix cli.sh for detecting Hadoop versions.
+ (Paul Huff via zshao)
+
Release 0.4.0 - Unreleased
INCOMPATIBLE CHANGES
Modified: hadoop/hive/trunk/bin/ext/cli.sh
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/bin/ext/cli.sh?rev=826850&r1=826849&r2=826850&view=diff
==============================================================================
--- hadoop/hive/trunk/bin/ext/cli.sh (original)
+++ hadoop/hive/trunk/bin/ext/cli.sh Mon Oct 19 22:44:48 2009
@@ -13,20 +13,15 @@
if $cygwin; then
HIVE_LIB=`cygpath -w "$HIVE_LIB"`
fi
-
- for f in ${HADOOP_HOME}/hadoop*core.jar ${HADOOP_HOME}/lib/hadoop*core.jar ${HADOOP_HOME}/build/hadoop*core.jar; do
- if [[ ! -f $f ]]; then
- continue;
- fi
- if [[ $f == *17* ]] || [[ $f == *18* ]] || [[ $f == *19* ]]; then
- exec $HADOOP jar $AUX_JARS_CMD_LINE ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@"
- break
- else
- # hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf
- exec $HADOOP jar ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@"
- break
- fi
- done
+
+ version=$($HADOOP version | awk '{print $2;}');
+
+ if [[ $version =~ "^0\.17" ]] || [[ $version =~ "^0\.18" ]] || [[ $version =~ "^0.19" ]]; then
+ exec $HADOOP jar $AUX_JARS_CMD_LINE ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@"
+ else
+ # hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf
+ exec $HADOOP jar ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@"
+ fi
}