+10 votes
5 views
in Big Data Hadoop & Spark by (1.2k points)
I am having some trouble writing the code for wordcount program using MapReduce, I could use some help.

2 Answers

0 votes
by (13.2k points)

Word count MapReduce is probably the first code everyone tries after installing Hadoop, so before I get into code, you want to make sure that you already have a file in HDFS which will serve as out input, if you don’t take help in getting the requisites done. 

Now, we must know what will our code perform, the wordcount reads text files and counts the frequency of the words in the text file. Each mapper takes a line of the input text file as ‘input’ and breaks it down into the words. 

Coming onto the code, you can find it in the link below

https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html

0 votes
by (25.6k points)

Firstly you need to know the concept of MapReduce. It can be explained with the following diagram:

Traditional Way:

image

MapReduce Way:

image

You can also refer the following video for more information regarding Mapreduce:

...