hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zs...@apache.org
Subject svn commit: r831810 - in /hadoop/hive/trunk: CHANGES.txt bin/ext/cli.sh
Date Mon, 02 Nov 2009 07:19:02 GMT
Author: zshao
Date: Mon Nov  2 07:19:02 2009
New Revision: 831810

URL: http://svn.apache.org/viewvc?rev=831810&view=rev
Log:
HIVE-902. Fix cli.sh to work with hadoop versions less than 20. (Carl Steinbach 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=831810&r1=831809&r2=831810&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Mon Nov  2 07:19:02 2009
@@ -225,6 +225,9 @@
     HIVE-840. No error if user specifies multiple columns of same name as
     output (He Yongqiang via namit)
 
+    HIVE-902. Fix cli.sh to work with hadoop versions less than 20.
+    (Carl Steinbach 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=831810&r1=831809&r2=831810&view=diff
==============================================================================
--- hadoop/hive/trunk/bin/ext/cli.sh (original)
+++ hadoop/hive/trunk/bin/ext/cli.sh Mon Nov  2 07:19:02 2009
@@ -14,9 +14,20 @@
     HIVE_LIB=`cygpath -w "$HIVE_LIB"`
   fi
 
-  version=$($HADOOP version | awk '{print $2;}');
+  version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');
 
-  if [[ $version =~ "^0\.17" ]] || [[ $version =~ "^0\.18" ]] || [[ $version =~ "^0.19" ]];
then
+  if [[ $version =~ ^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+).*$ ]]; then
+      major_ver=${BASH_REMATCH[1]}
+      minor_ver=${BASH_REMATCH[2]}
+      patch_ver=${BASH_REMATCH[3]}
+  else
+      echo "Unable to determine Hadoop version information."
+      echo "'hadoop version' returned:"
+      echo `$HADOOP version`
+      exit 6
+  fi
+
+  if [ $minor_ver -le 20 ]; 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



Mime
View raw message