RazorProgrammer
RazorProgrammer

Reputation: 137

Hadoop read files with following name patterns

This may sound very basic but I have a folder in HDFS with 3 kinds of files. eg:
access-02171990
s3.Log
catalina.out

I want my map/reduce to read only files which begin with access- only. How do I do that via program? or specifying via the input directory path? Please help.

Upvotes: 1

Views: 307

Answers (1)

Hari Menon
Hari Menon

Reputation: 35395

You can set the input path as a glob:

FileInputFormat.addInputPath(jobConf, new Path("/your/path/access*"))

Upvotes: 3

Related Questions