0

I am passing a file pattern:

FileInputFormat.addInputPath(job, new Path("/path/to/file*"));

And I wish to know which files actually matches it after the job finished running, provided that it was successful.

I have tried:

job.getConfiguration().get("mapreduce.input.fileinputformat.inputdir")

but it is returning the same thing:

"/path/to/file*"

I am wondering if there's a method to get the matching Paths without resorting to creating another routine to do the scanning of directories.

Your enlightenment is much appreciated.

1 Answers1

0

Try this link, it has a few ways to get the path in the mapper. But, I am sure its talking about a few more ways. :)

How to get the input file name in the mapper in a Hadoop program?

Community
  • 1
  • 1
Rachit Ahuja
  • 371
  • 2
  • 15
  • Thanks, I did try out and check out the methods there before. I can get the input paths in mapper but not sure how to pass in back to main class. Having spent quite some time finding solution, I have resorted to the less graceful, aforementioned method. Thanks anyway. – FailedMathematician Jul 19 '15 at 06:35