Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15948

Inconsistency in get and put syntax if filename/dirname contains space

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.1
    • 3.0.4, 3.3.0, 3.2.1, 3.1.3
    • fs
    • None
    • Reviewed

    Description

      Inconsistency in get and put syntax if file/fdir name contains space. 

      While copying file/dir from local to HDFS, space needs to be represented with %20. However, the same representation does not work for copying file to Local. Expectaion is to have same syntax for both get and put.

      test:/ # mkdir /opt/
      test:/ # mkdir /opt/test\ space
      test:/ # vi /opt/test\ space/test\ file.txt
      test:/ # ll /opt/test\ space/
      total 4
      rw-rr- 1 root root 7 Sep 12 18:37 test file.txt
      test:/ #
      test:/ # hadoop fs -put /opt/test\ space/ /tmp/
      put: unexpected URISyntaxException
      test:/ #
      test:/ # hadoop fs -put /opt/test%20space/ /tmp/
      test:/ #
      test:/ # hadoop fs -ls /tmp
      drwxr-xr-x - user1 hadoop 0 2018-09-12 18:38 /tmp/test space
      test:/ #
      test:/ # hadoop fs -get /tmp/test%20space /srv/
      get: `/tmp/test%20space': No such file or directory
      test:/ #
      test:/ # hadoop fs -get /tmp/test\ space /srv/
      test:/ # ll /srv/test\ space/
      total 4
      rw-rr- 1 root root 7 Sep 12 18:39 test file.txt

      Attachments

        1. HDFS-13911-02.patch
          3 kB
          Ayush Saxena
        2. HDFS-13911-01.patch
          1.0 kB
          Ayush Saxena

        Activity

          People

            ayushtkn Ayush Saxena
            vivek.kumar vivek kumar
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: