Details
-
Bug
-
Status: Triage Needed
-
P2
-
Resolution: Fixed
-
2.17.0
-
None
Description
HadoopResourceId returns for directory uri wrong fileName() which doesnt conform ResourceId interface javadoc
Returns the name of the file or directory..
String getFilename();
URI hdfsClusterBaseUri = new URI(configuration.get("fs.defaultFS") + "/"); HadoopResourceId hadoopResourceId = new HadoopResourceId(hdfsClusterBaseUri.resolve("/dirA/file1"));
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() is using hadoop Path.getName() which returns everything after last slash.