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 ee6c564..f50656e 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 @@ -2695,8 +2695,10 @@ private static void copyFiles(final HiveConf conf, final FileSystem destFs, } } else { destPath = mvFile(conf, srcP, destPath, isSrcLocal, srcFs, destFs, name, filetype); + // The above mvFile() creates a new file in the desf and copy the bytes from srcP to destPath. + // The new file created will always inherit the permission of destf. + srcGroup = fullDestStatus.getFileStatus().getGroup(); } - if (inheritPerms) { HdfsUtils.setFullFileStatus(conf, fullDestStatus, srcGroup, destFs, destPath, false); }