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

Add Glob unit test for special characters

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 3.0.0-alpha1
    • fs
    • None
    • Reviewed

    Description

      On branch-2, the below is the (incorrect) behaviour today, where paths with special characters get dropped during globStatus calls:

      bin/hdfs dfs -mkdir /foo
      bin/hdfs dfs -touchz /foo/foo1
      bin/hdfs dfs -touchz $'/foo/foo1\r'
      bin/hdfs dfs -ls '/foo/*'
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1^M
      bin/hdfs dfs -ls '/foo/*'
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1
      

      Whereas trunk has the right behaviour, subtly fixed via the pattern library change of HADOOP-12436:

      bin/hdfs dfs -mkdir /foo
      bin/hdfs dfs -touchz /foo/foo1
      bin/hdfs dfs -touchz $'/foo/foo1\r'
      bin/hdfs dfs -ls '/foo/*'
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1^M
      bin/hdfs dfs -ls '/foo/*'
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1
      -rw-r--r--   3 harsh supergroup          0 2016-04-22 17:35 /foo/foo1^M
      

      (I've placed a ^M explicitly to indicate presence of the intentional hidden character)

      We should still add a simple test-case to cover this situation for future regressions.

      Attachments

        1. HADOOP-13051.000.patch
          1 kB
          Harsh J

        Issue Links

          Activity

            People

              qwertymaniac Harsh J
              qwertymaniac Harsh J
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: