HIVE-10610 : hive command fails to get hadoop version (Shwetha G S via Sushanth 
Sowmyan)


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

Branch: refs/heads/beeline-cli
Commit: 377ba4ba164d46ca91390d7d38c13e4e2fcda383
Parents: a9d70a0
Author: Sushanth Sowmyan <khorg...@gmail.com>
Authored: Wed May 6 10:58:08 2015 -0700
Committer: Sushanth Sowmyan <khorg...@gmail.com>
Committed: Wed May 6 10:58:50 2015 -0700

----------------------------------------------------------------------
 bin/hive | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/377ba4ba/bin/hive
----------------------------------------------------------------------
diff --git a/bin/hive b/bin/hive
index 50bd726..5dc93fb 100755
--- a/bin/hive
+++ b/bin/hive
@@ -201,7 +201,7 @@ fi
 
 # Make sure we're using a compatible version of Hadoop
 if [ "x$HADOOP_VERSION" == "x" ]; then
-    HADOOP_VERSION=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');
+    HADOOP_VERSION=$($HADOOP version | awk -F"\t" '/Hadoop/ {print $0}' | cut 
-d' ' -f 2);
 fi
 
 # Save the regex to a var to workaround quoting incompatabilities

Reply via email to