You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Andras Bokor (JIRA)" <ji...@apache.org> on 2017/06/16 11:41:00 UTC
[jira] [Commented] (HADOOP-7464) hadoop fs -stat '{glob}' gives
null with combo of absolute and non-existent files
[ https://issues.apache.org/jira/browse/HADOOP-7464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051792#comment-16051792 ]
Andras Bokor commented on HADOOP-7464:
--------------------------------------
Closing as dup of HADOOP-7174.
Please note that hadoop fs -stat \{file1,file2\} is different from {{hadoop fs -stat '\{file1,file2\}'}}.
The first case will be translated by shell to call hadoop fs individually with file1 and file2.
The second case will send to Hadoop \{file1,file2\} which is in fact a glob and means something else. Please check {{org.apache.hadoop.fs.GlobExpander#expand}} for the details.
> 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
> Assignee: Andras Bokor
> 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 was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org