Passing parameters to map function in Hadoop

Pooja N Babu picture Pooja N Babu · Dec 10, 2011 · Viewed 22.8k times · Source

I am new to Hadoop. I want to access a command line argument from main function(Java program) inside the map function of the mapper class. Please suggest ways to do this.

Answer

Praveen Sripati picture Praveen Sripati · Dec 10, 2011

Hadoop 0.20, introduced new MR API, there is not much functionality difference between the new (o.a.h.mapreduce package) and old MR API (o.a.h.mapred) except that data can be pulled within the mappers and the reducers using the new API. What Arnon is mentioned is with the old API.

Check this article for passing the parameters using the new and old API.