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

FsShell -getmerge source file pattern is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.23.0
    • None
    • fs
    • None

    Description

      The FsShell -getmerge command doesn't work if the "source file pattern" matches files. See below. If the current behavior is intended then we should update the help documentation and java docs to match, but it would be nice if the user could specify a set of files in a directory rather than just directories.

      $ hadoop fs -help getmerge
      -getmerge <src> <localdst>:  Get all the files in the directories that 
      		match the source file pattern and merge and sort them to only
      		one file on local fs. <src> is kept.
      $ hadoop fs -ls
      Found 3 items
      -rw-r--r--   1 eli supergroup          2 2009-11-23 17:39 /user/eli/1.txt
      -rw-r--r--   1 eli supergroup          2 2009-11-23 17:39 /user/eli/2.txt
      -rw-r--r--   1 eli supergroup          2 2009-11-23 17:39 /user/eli/3.txt
      $ hadoop fs -getmerge /user/eli/*.txt sorted.txt
      $ cat sorted.txt
      cat: sorted.txt: No such file or directory
      $ hadoop fs -getmerge /user/eli/* sorted.txt
      $ cat sorted.txt
      cat: sorted.txt: No such file or directory
      $ hadoop fs -getmerge /user/* sorted.txt
      $ cat sorted.txt 
      1
      2
      3
      

      Attachments

        1. HADOOP-6387.patch
          4 kB
          XieXianshan

        Issue Links

          Activity

            People

              daryn Daryn Sharp
              eli Eli Collins
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: