Word Count Example using Hadoop and Java

In this comprehensive tutorial I have shown how you can write code for Word Count Example Hadoop for Map Reduce. 

Step 1 : Add the dependencies

First of all add this dependencies hadoop-common and  hadoop-mapreduce-client-core to your pom.xml file. 
Source Code :

Step 2: Create Word Count Mapper file

Create WC_Mapper.java file and add the following code on it.
WC_Mapper.java

Step 3 : Create Word Count Reducer file

Create WC_Reducer.java file and add the following code on it.
WC_Reducer.java

Step 4 : Create Word Count Runner file

Create WC_Runner.java file and add the following code on it.
WC_Runner.java

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top