diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 66203a5..c8a8a64 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2471,7 +2471,7 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist", "set,reset,dfs,add,list,delete,reload,compile", "Comma separated list of non-SQL Hive commands users are authorized to execute"), - HIVE_MOVE_FILES_THREAD_COUNT("hive.mv.files.thread", 25, new SizeValidator(0L, true, 1024L, true), "Number of threads" + HIVE_MOVE_FILES_THREAD_COUNT("hive.mv.files.thread", 15, new SizeValidator(0L, true, 1024L, true), "Number of threads" + " used to move files in move task. Set it to 0 to disable multi-threaded file moves. This parameter is also used by" + " MSCK to check tables."), // If this is set all move tasks at the end of a multi-insert query will only begin once all 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 ef0bb3d..10f9cc7 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -2941,8 +2941,9 @@ public static boolean moveFile(final HiveConf conf, Path srcf, final Path destf, /* Move files one by one because source is a subdirectory of destination */ for (final FileStatus srcStatus : srcs) { + final Path destFile = new Path(destf, srcStatus.getPath().getName()); if (null == pool) { - if(!destFs.rename(srcStatus.getPath(), destf)) { + if(!destFs.rename(srcStatus.getPath(), destFile)) { throw new IOException("rename for src path: " + srcStatus.getPath() + " to dest:" + destf + " returned false"); } @@ -2951,15 +2952,14 @@ public static boolean moveFile(final HiveConf conf, Path srcf, final Path destf, @Override public Void call() throws Exception { SessionState.setCurrentSessionState(parentSession); - final Path destPath = new Path(destf, srcStatus.getPath().getName()); final String group = srcStatus.getGroup(); - if(destFs.rename(srcStatus.getPath(), destf)) { + if(destFs.rename(srcStatus.getPath(), destFile)) { if (inheritPerms) { - HdfsUtils.setFullFileStatus(conf, desiredStatus, group, destFs, destPath, false); + HdfsUtils.setFullFileStatus(conf, desiredStatus, group, destFs, destFile, false); } } else { throw new IOException("rename for src path: " + srcStatus.getPath() + " to dest path:" - + destPath + " returned false"); + + destFile + " returned false"); } return null; }