Author: vikram
Date: Tue Dec 30 22:38:28 2014
New Revision: 1648620

URL: http://svn.apache.org/r1648620
Log:
HIVE-9205: Change default tez install directory to use /tmp instead of /user 
and create the directory if it does not exist (Vikram Dixit K, reviewed by 
Prasanth J and Gunther Hagleitner)

Modified:
    
hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java

Modified: 
hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
URL: 
http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java?rev=1648620&r1=1648619&r2=1648620&view=diff
==============================================================================
--- 
hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
 (original)
+++ 
hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
 Tue Dec 30 22:38:28 2014
@@ -771,9 +771,14 @@ public class DagUtils {
     String hdfsDirPathStr = jarPathStr;
     Path hdfsDirPath = new Path(hdfsDirPathStr);
 
-    FileStatus fstatus = fs.getFileStatus(hdfsDirPath);
-    if (!fstatus.isDir()) {
-      throw new 
IOException(ErrorMsg.INVALID_DIR.format(hdfsDirPath.toString()));
+    try {
+      FileStatus fstatus = fs.getFileStatus(hdfsDirPath);
+      if (!fstatus.isDir()) {
+        throw new 
IOException(ErrorMsg.INVALID_DIR.format(hdfsDirPath.toString()));
+      }
+    } catch (FileNotFoundException e) {
+      // directory does not exist, create it
+      fs.mkdirs(hdfsDirPath);
     }
 
     Path retPath = new Path(hdfsDirPath.toString() + "/.hiveJars");


Reply via email to