Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop, mail # user - java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.LongWritable, recieved org.apache.hadoop.io.Text


Copy link to this message
-
Re: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.LongWritable, recieved org.apache.hadoop.io.Text
Bejoy Ks 2012-08-02, 23:07
Hi Harit

You need to set the Key Type as well. If you are using different Data Type
for Key and Values in your map output with respect to reduce output then
you need to specify both.

 //setting the map output data type classes
            job.setMapOutputKeyClass(LongWritable.class);
            job.setMapOutputValueClass(Text.class);

 //setting the final reduce output data type classes
            job.setOutputKeyClass(Text.class);
            job.setOutputValueClass(IntWritable.class);

Regards
Bejoy KS