RKCY
RKCY

Reputation: 4135

Does mapper class is mandatory in hadoop mapreduce program

As i know if mapper class in not mentioned in the driver class, it will use the identity mapper as well as same for reducer also. But if not writing any mapper class, who will call the hdfs input data and process it and send to reducer.

Upvotes: 1

Views: 444

Answers (1)

Ashrith
Ashrith

Reputation: 6855

Mapper class is mandatory. As you said if you don't specify the Mapper class in the driver then IdentityMapper will be used.

But if not writing any mapper class, who will call the hdfs input data and process it and send to reducer.

So if you are not writing any mapper class, IdentityMapper will process the input data (specified in the driver class) and send it to the reducer.

Edge case: there will some cases where mapper's instead of reading the input data will generate there own data randomly for example PiEstimator from mapreduce examples does not read input data but rather will generate random data and pass that data to the reducer's. Also TeraGen does the same.

Upvotes: 1

Related Questions