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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]