
Mapper
Mapper is a process of generating results in the form of key-value pairs based on the input provided. It takes input as <key,value> pairs and outputs them in the same format that can be different in terms of data type.
The number in Mapper depends on the number of Input Splits involved in storing data. Let's assume that there are four Input Splits involved - there will four mappers involved in processing. The following figure illustrates what happens in the Mapper function:

Record Reader is responsible for converting data into key-value pairs for Mapper. When the program executes, Mapper will run on DataNode-1, DataNode-2, DataNode-3, and DataNode-4 to take advantage of parallel processing; this is because independent data nodes contain different data blocks of the same file. Mapper will then produce output in the form of key-value pairs. This result is called Intermediate Results.