Hi, Why not just use: FileSystem fs = FileSystem.get(conf); FileStatus[] files = fs.globStatus(new Path(path+filter));
Thanks, -Idris On Mon, Feb 27, 2012 at 1:06 PM, Harsh J <ha...@cloudera.com> wrote: > Hi Simon, > > You need to implement your custom PathFilter derivative class, and > then set it via your {File}InputFormat class using setInputPathFilter: > > > http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/mapred/FileInputFormat.html#setInputPathFilter(org.apache.hadoop.mapred.JobConf,%20java.lang.Class)<http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/mapred/FileInputFormat.html#setInputPathFilter%28org.apache.hadoop.mapred.JobConf,%20java.lang.Class%29> > > (TextInputFormat is a derivative of FileInputFormat, and hence has the > same method.) > > HTH. > > 2012/2/23 Heeg, Simon <s.h...@telekom.de>: > > Hello, > > > > I would like to use a PathFilter for filtering the files with a regular > expression which are read by the TextInputFormat, but I don't know how to > apply the filter. I cannot find a setter. Unfortunately google was not my > friend with this issue and "The definitive Guide" does not help that much. > I am using Hadoop 0.20.2-cdh3u3. > > > > -- > Harsh J >