aasha commented on a change in pull request #1925:
URL: https://github.com/apache/hive/pull/1925#discussion_r571813927



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/DirCopyTask.java
##########
@@ -70,9 +76,40 @@ private boolean createAndSetPathOwner(Path destPath, Path 
sourcePath) throws IOE
             destPath, sourcePath, status.getOwner(), status.getGroup(), 
status.getPermission());
     destPath.getFileSystem(conf).setOwner(destPath, status.getOwner(), 
status.getGroup());
     destPath.getFileSystem(conf).setPermission(destPath, 
status.getPermission());
+    setAclsToTarget(status, sourcePath, destPath);
     return createdDir;
   }
 
+  private void setAclsToTarget(FileStatus sourceStatus, Path sourcePath,
+      Path destPath) throws IOException {
+    // Check if distCp options contains preserve ACL.
+    if (isPreserveAcl()) {
+      AclStatus sourceAcls =
+          sourcePath.getFileSystem(conf).getAclStatus(sourcePath);
+      if (sourceAcls != null && sourceAcls.getEntries().size() > 0) {
+        destPath.getFileSystem(conf).removeAcl(destPath);

Review comment:
       why is this call needed?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to