diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java index 033f463..d06bdb9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java @@ -770,9 +770,14 @@ public Path getDefaultDestDir(Configuration conf) throws LoginException, IOExcep 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");