[
https://issues.apache.org/jira/browse/HIVE-25960?focusedWorklogId=729688&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-729688
]
ASF GitHub Bot logged work on HIVE-25960:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Feb/22 14:27
Start Date: 18/Feb/22 14:27
Worklog Time Spent: 10m
Work Description: 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 729688)
Time Spent: 40m (was: 0.5h)
> Fix S3a recursive listing logic
> -------------------------------
>
> Key: HIVE-25960
> URL: https://issues.apache.org/jira/browse/HIVE-25960
> Project: Hive
> Issue Type: Bug
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> To make the path relative:
> Path relativePath = new
> Path(each.getPath().toString().replace(base.toString(), ""));
>
> Here base in the FileStatus not the path. It should be
> base.getPath().toString() and instead of replace it should be replaceFirst()
--
This message was sent by Atlassian Jira
(v8.20.1#820001)