[
https://issues.apache.org/jira/browse/BEAM-9123?focusedWorklogId=374487&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-374487
]
ASF GitHub Bot logged work on BEAM-9123:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jan/20 10:04
Start Date: 20/Jan/20 10:04
Worklog Time Spent: 10m
Work Description: aromanenko-dev commented on issue #10626:
[release-2.19.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix
URL: https://github.com/apache/beam/pull/10626#issuecomment-576199715
Run Java_Examples_Dataflow PreCommit
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 374487)
Time Spent: 2h 50m (was: 2h 40m)
> HadoopResourceId returns wrong directory name
> ---------------------------------------------
>
> Key: BEAM-9123
> URL: https://issues.apache.org/jira/browse/BEAM-9123
> Project: Beam
> Issue Type: Bug
> Components: io-java-hadoop-file-system
> Affects Versions: 2.17.0
> Reporter: Marek Simunek
> Assignee: Marek Simunek
> Priority: Major
> Fix For: 2.18.0
>
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> _HadoopResourceId_ returns for directory uri wrong fileName() which doesnt
> conform _ResourceId_ interface javadoc
> {color:#629755}Returns the name of the file or directory..{color}
> String {color:#ffc66d}getFilename{color}(){color:#cc7832}; {color}
>
> {code:java}
> URI hdfsClusterBaseUri = new URI(configuration.get("fs.defaultFS") + "/");
> HadoopResourceId hadoopResourceId =
> new HadoopResourceId(hdfsClusterBaseUri.resolve("/dirA/file1"));{code}
> Expected behavior:
> _hadoopResourceId.getCurrentDirectory().getFilename()_ returns *dirA*
> Actual behavior:
> _hadoopResourceId.getCurrentDirectory().getFilename()_ returns *""*
> The problem is that uri for folder is ending with '*/*' and
> [getFileName()|https://github.com/apache/beam/blob/master/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java#L68]
> is using hadoop Path.getName() which returns everything after last slash.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)