When your working with Map-reduce job,
If you are running into this error, "java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable"
solution:
//your Map and/or Reduce implementation
Map<Text,IntWritable,Text,IntWritable>(...)
Reducer<Text,IntWritable,Text,IntWritable>(...)
//the job configuration
// Set the outputs for the Map
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(IntWritable.class);
// Set the outputs for the Job
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
Some time generic map and reduce class will cause this kind problems
No comments:
Post a Comment