[ https://issues.apache.org/jira/browse/BEAM-9123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17016913#comment-17016913 ]
Alexey Romanenko commented on BEAM-9123: ---------------------------------------- Is it really going to be included into 2.18 release (1st release candidate was done yesterday)? > 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: 0.5h > 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)