diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 2fe86e1..a27038b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -2215,7 +2215,7 @@ static protected boolean renameFile(HiveConf conf, Path srcf, Path destf, FileSy } } success = fs.rename(srcf, destf); - LOG.debug((replace ? "Replacing src:" : "Renaming src:") + srcf.toString() + LOG.info((replace ? "Replacing src:" : "Renaming src:") + srcf.toString() + ";dest: " + destf.toString() + ";Status:" + success); } catch (IOException ioe) { throw new HiveException("Unable to move source" + srcf + " to destination " + destf, ioe); @@ -2317,10 +2317,7 @@ static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf } List> result = checkPaths(conf, fs, srcs, destf, true); - // point of no return -- delete oldPath only if it is not same as destf, - // otherwise, the oldPath/destf will be cleaned later just before move - if (oldPath != null && (!destf.getFileSystem(conf).equals(oldPath.getFileSystem(conf)) - || !destf.equals(oldPath))) { + if (oldPath != null) { try { FileSystem fs2 = oldPath.getFileSystem(conf); if (fs2.exists(oldPath)) { @@ -2341,6 +2338,9 @@ static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf Path destfp = destf.getParent(); if (!fs.exists(destfp)) { boolean success = fs.mkdirs(destfp); + if (!success) { + LOG.warn("Error creating directory " + destf.toString()); + } if (inheritPerms && success) { fs.setPermission(destfp, fs.getFileStatus(destfp.getParent()).getPermission()); } @@ -2354,6 +2354,9 @@ static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf } else { // srcf is a file or pattern containing wildcards if (!fs.exists(destf)) { boolean success = fs.mkdirs(destf); + if (!success) { + LOG.warn("Error creating directory " + destf.toString()); + } if (inheritPerms && success) { fs.setPermission(destf, fs.getFileStatus(destf.getParent()).getPermission()); }