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

Key: HADOOP-7464
URL: https://issues.apache.org/jira/browse/HADOOP-7464
Project: Hadoop Common
Issue Type: Bug
Components: fs
Affects Versions: 0.20.2
Environment: CDH3u0
Reporter: Jay Hacker
Priority: Minor


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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedJul 15, '11 at 9:39p
activeJul 15, '11 at 9:39p
posts1
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Jay Hacker (JIRA): 1 post

People

Translate

site design / logo © 2022 Grokbase