diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java index 583b82b..f45d19e 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java @@ -99,7 +99,9 @@ private void moveFile(Path sourcePath, Path targetPath, boolean isDfsDir) if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) { deletePath = createTargetPath(targetPath, fs); } - if (!Hive.renameFile(conf, sourcePath, targetPath, fs, true, false)) { + // All hdfs file names should have been normalized by now for this check to work. + boolean isSrcLocal = sourcePath.getName().startsWith("hdfs://") == true ? false : true; + if (!Hive.renameFile(conf, sourcePath, targetPath, fs, true, isSrcLocal)) { try { if (deletePath != null) { fs.delete(deletePath, true);