Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-9123

HadoopResourceId returns wrong directory name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 2.17.0
    • Fix Version/s: 2.19.0
    • Labels:
      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.

       

        Attachments

          Activity

            People

            • Assignee:
              marek.simunek Marek Simunek
              Reporter:
              marek.simunek Marek Simunek
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4h 40m
                4h 40m