hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: HDFS Path with special char
Date Wed, 21 Mar 2012 11:16:29 GMT
Seems to me like you are looking for globbing your path results out.
This is possible, just pass your pattern to this API call
(FileSystem.globStatus instead of FileSystem.listStatus) and then
iterate over the returned listing:
http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#globStatus(org.apache.hadoop.fs.Path)

On Wed, Mar 21, 2012 at 4:01 PM, Thamizhannal Paramasivam
<thamizhannal.p@gmail.com> wrote:
> Hi All,
>
> Can n't we use special character to get paths in HDFS using Hadoop API.
>
> E.g. Path path = new Path("/data/input/20120321*");
> I have filesĀ  /data/input/20120321000000/a.txt ,
> /data/input/20120321010000/b.txt and /data/input/20120321020000/c.txt under
> "/data/input/" folder.
>
> I wanted to all the files correponding to a single day. E.g. File:
> /data/input date: 20120321
>
> How can I do that using Hadoop API.
>
> Any help would be appreciated.
>
> Thanks,
> Thamizh



-- 
Harsh J

Mime
View raw message