Index: bin/ext/cli.sh =================================================================== --- bin/ext/cli.sh (revision 829849) +++ bin/ext/cli.sh (working copy) @@ -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