You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/04/09 12:57:55 UTC

[GitHub] [hadoop] ayushtkn commented on a change in pull request #1857: HADOOP-16878. Copy command in FileUtil to throw an exception if the source and destination is the same

ayushtkn commented on a change in pull request #1857: HADOOP-16878. Copy command in FileUtil to throw an exception if the source and destination is the same
URL: https://github.com/apache/hadoop/pull/1857#discussion_r406184443
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
 ##########
 @@ -398,6 +398,13 @@ public static boolean copy(FileSystem srcFS, FileStatus srcStatus,
                              Configuration conf) throws IOException {
     Path src = srcStatus.getPath();
     dst = checkDest(src.getName(), dstFS, dst, overwrite);
+
+    if (dst != null && src != null &&
+        src.toUri().equals(dst.toUri())) {
 
 Review comment:
   Can we use :
   `srcFS.makeQualified(src).equals(dstFS.makeQualified(dst))`
   instead of uri comparison, As I said on Jira, this URI comparison isn't working with HDFS

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org