You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/02/18 14:27:58 UTC
[GitHub] [hive] ayushtkn commented on a change in pull request #3031: HIVE-25960: Fix S3a recursive listing logic.
ayushtkn commented on a change in pull request #3031:
URL: https://github.com/apache/hive/pull/3031#discussion_r810047254
##########
File path: common/src/java/org/apache/hadoop/hive/common/FileUtils.java
##########
@@ -361,7 +361,7 @@ private static void listS3FilesRecursive(FileStatus base, FileSystem fs, List<Fi
RemoteIterator<LocatedFileStatus> remoteIterator = fs.listFiles(base.getPath(), true);
while (remoteIterator.hasNext()) {
LocatedFileStatus each = remoteIterator.next();
- Path relativePath = new Path(each.getPath().toString().replace(base.toString(), ""));
+ Path relativePath = new Path(each.getPath().toString().replaceFirst(base.getPath().toString(), ""));
Review comment:
Thanx @abstractdog for the review.
>isn't [Path.relativize](https://www.geeksforgeeks.org/path-relativize-method-in-java-with-examples/) for the same purpose?
This Path & the path used here is different, the first one is from the Java package. The latter one is from Hadoop-Common
https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
>b) if it isn't, could you please refactor this to utility method here? in this case, please include unit test into TestFileUtils
Done
--
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.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org