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

hadoop fs -stat '{glob}' gives null with combo of absolute and non-existent files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.20.2
    • None
    • fs
    • None
    • CDH3u0

    Description

      I'm trying to hadoop fs -stat a list of HDFS files all at once, because doing them one at a time is slow. stat doesn't accept multiple arguments, so I'm using a glob of the form '{file1,file2}' (quoted from the shell). I've discovered this doesn't work for me because the glob expands non-existent files to nothing, and I get nothing back from stat. It would be nice to be able to use stat for this, but perhaps that's more of a feature request.

      However, in the process, I discovered that with relative pathnames, I get back the stats for the existing files. With absolute filenames, I get back stat: null.

      $ hadoop fs -touchz file1 file2
      $ hadoop fs -stat '{file1,file2}'
      2011-07-15 21:21:19
      2011-07-15 21:21:19
      $ hadoop fs -stat '{file1,file2,nonexistent}'
      2011-07-15 21:21:19
      2011-07-15 21:21:19
      $ hadoop fs -stat '{user/me/file1,/user/me/file2}'
      2011-07-15 21:21:19
      2011-07-15 21:21:19
      $ hadoop fs -stat '{/user/me/file1,/user/me/file2,nonexistent}'
      stat: null

      Perhaps I'm doing something dumb, but it seems like stat should give the same results whether you use relative or absolute paths.

      Attachments

        Issue Links

          Activity

            People

              boky01 Andras Bokor
              jayqhacker Jay Hacker
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: