• Post Reply Bookmark Topic Watch Topic
  • New Topic

WordCount program giving exception.

 
Ravi Bansal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am facing this exception when trying to run the first program on hadoop. (I am using hadoop new API on version 0.20.2).
I searched on web, it looks like most of the people faced this problem when they did not set MapperClass and ReducerClass in the configuration logic.
But I checked and it looks the code is ok . I will really appreciate if someone can help me out.


java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:871)



Mapper class


Reducer Class




Configuration Class

 
Ravi Bansal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its sorted out now ...stupid mistake from me.....Map function in mapper class should have been fixed to remove upper case letter M , it should have been map
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!