HIVE-15212 : merge branch into master - fix some tests (Sergey Shelukhin)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a02a61b3 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a02a61b3 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a02a61b3 Branch: refs/heads/hive-14535 Commit: a02a61b3e242732cb57f21dc18358e205113da8a Parents: a0c546f Author: sergey <[email protected]> Authored: Thu Sep 28 20:33:30 2017 -0700 Committer: sergey <[email protected]> Committed: Thu Sep 28 20:33:30 2017 -0700 ---------------------------------------------------------------------- ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java | 1 - ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/a02a61b3/ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java index 1a9b39f..b7d65ec 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/ReplCopyTask.java @@ -61,7 +61,6 @@ public class ReplCopyTask extends Task<ReplCopyWork> implements Serializable { FileSystem dstFs = null; Path toPath = null; try { - // TODO: merge with real CopyTask logic? Path fromPath = work.getFromPaths()[0]; toPath = work.getToPaths()[0]; http://git-wip-us.apache.org/repos/asf/hive/blob/a02a61b3/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index d4282ed..5fd4ecc 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -63,6 +63,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileChecksum; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hive.common.BlobStorageUtils; @@ -3895,6 +3896,9 @@ private void constructOneLBLocationMap(FileStatus fSta, private void cleanUpOneDirectoryForReplace(Path path, FileSystem fs, PathFilter pathFilter, HiveConf conf, boolean purge) throws IOException, HiveException { + if (conf.getBoolVar(HiveConf.ConfVars.REPLCMENABLED)) { + recycleDirToCmPath(path, purge); + } FileStatus[] statuses = fs.listStatus(path, pathFilter); if (statuses == null || statuses.length == 0) return; if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) { @@ -3904,6 +3908,7 @@ private void constructOneLBLocationMap(FileStatus fSta, } Utilities.FILE_OP_LOGGER.trace(s); } + if (!trashFiles(fs, statuses, conf, purge)) { throw new HiveException("Old path " + path + " has not been cleaned up."); }
