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

HadoopResourceId returns wrong directory name

Details

    • Bug
    • Status: Triage Needed
    • P2
    • Resolution: Fixed
    • 2.17.0
    • 2.19.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.

       

      Attachments

        Activity

          People

            marek.simunek Marek Simunek
            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