private boolean setTargetPathOwner(Path targetPath, Path sourcePath, UserGroupInformation proxyUser,
      HiveConf clonedConf)
            throws IOException, InterruptedException {
    if (proxyUser == null) {
      return createAndSetPathOwner(targetPath, sourcePath, clonedConf);
    }
    return proxyUser.doAs((PrivilegedExceptionAction<Boolean>) () -> createAndSetPathOwner(targetPath, sourcePath,
        clonedConf));
  }
DirCopyTask, mainly to be used to copy External table data.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/DirCopyTask.java