Author: sershe
Date: Fri Mar 14 18:01:10 2014
New Revision: 1577627

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

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

Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1577627&r1=1577626&r2=1577627&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 
(original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Fri 
Mar 14 18:01:10 2014
@@ -933,7 +933,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/trunk/conf/hive-default.xml.template
URL: 
http://svn.apache.org/viewvc/hive/trunk/conf/hive-default.xml.template?rev=1577627&r1=1577626&r2=1577627&view=diff
==============================================================================
--- hive/trunk/conf/hive-default.xml.template (original)
+++ hive/trunk/conf/hive-default.xml.template Fri Mar 14 18:01:10 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/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java?rev=1577627&r1=1577626&r2=1577627&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java 
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java Fri 
Mar 14 18:01:10 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())) {


Reply via email to