You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2014/03/14 19:01:25 UTC

svn commit: r1577628 - in /hive/branches/branch-0.13: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java conf/hive-default.xml.template ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java

Author: sershe
Date: Fri Mar 14 18:01:25 2014
New Revision: 1577628

URL: http://svn.apache.org/r1577628
Log:
HIVE-6636 : /user/hive is a bad default for HDFS jars path for Tez (Sergey Shelukhin, reviewed by Gunther Hagleitner)

Modified:
    hive/branches/branch-0.13/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hive/branches/branch-0.13/conf/hive-default.xml.template
    hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java

Modified: hive/branches/branch-0.13/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1577628&r1=1577627&r2=1577628&view=diff
==============================================================================
--- hive/branches/branch-0.13/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/branches/branch-0.13/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Fri Mar 14 18:01:25 2014
@@ -930,7 +930,7 @@ public class HiveConf extends Configurat
 
     HIVE_EXECUTION_ENGINE("hive.execution.engine", "mr",
         new StringsValidator("mr", "tez")),
-    HIVE_JAR_DIRECTORY("hive.jar.directory", "hdfs:///user/hive/"),
+    HIVE_JAR_DIRECTORY("hive.jar.directory", null),
     HIVE_USER_INSTALL_DIR("hive.user.install.directory", "hdfs:///user/"),
 
     // Vectorization enabled

Modified: hive/branches/branch-0.13/conf/hive-default.xml.template
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/conf/hive-default.xml.template?rev=1577628&r1=1577627&r2=1577628&view=diff
==============================================================================
--- hive/branches/branch-0.13/conf/hive-default.xml.template (original)
+++ hive/branches/branch-0.13/conf/hive-default.xml.template Fri Mar 14 18:01:25 2014
@@ -2377,10 +2377,11 @@
 
 <property>
   <name>hive.jar.directory</name>
-  <value>hdfs:///user/hive/</value>
+  <value></value>
   <description>
     This is the location hive in tez mode will look for to find a site wide 
-    installed hive instance.
+    installed hive instance. If not set, the directory under hive.user.install.directory 
+    corresponding to current user name will be used.
   </description>
 </property>
 

Modified: hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java?rev=1577628&r1=1577627&r2=1577628&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java (original)
+++ hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java Fri Mar 14 18:01:25 2014
@@ -598,18 +598,20 @@ public class DagUtils {
     // need to localize the additional jars and files
 
     // we need the directory on hdfs to which we shall put all these files
-    String hdfsDirPathStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_JAR_DIRECTORY);
-    Path hdfsDirPath = new Path(hdfsDirPathStr);
-    FileSystem fs = hdfsDirPath.getFileSystem(conf);
-    if (!(fs instanceof DistributedFileSystem)) {
-      throw new IOException(ErrorMsg.INVALID_HDFS_URI.format(hdfsDirPathStr));
-    }
-
+    // Use HIVE_JAR_DIRECTORY only if it's set explicitly; otherwise use default directory
     FileStatus fstatus = null;
-    try {
-      fstatus = fs.getFileStatus(hdfsDirPath);
-    } catch (FileNotFoundException fe) {
-      // do nothing
+    String hdfsDirPathStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_JAR_DIRECTORY, null);
+    if (hdfsDirPathStr != null) {
+      Path hdfsDirPath = new Path(hdfsDirPathStr);
+      FileSystem fs = hdfsDirPath.getFileSystem(conf);
+      if (!(fs instanceof DistributedFileSystem)) {
+        throw new IOException(ErrorMsg.INVALID_HDFS_URI.format(hdfsDirPathStr));
+      }
+      try {
+        fstatus = fs.getFileStatus(hdfsDirPath);
+      } catch (FileNotFoundException fe) {
+        // do nothing
+      }
     }
 
     if ((fstatus == null) || (!fstatus.isDir())) {