I'm using two mappers and two reducers. I'm getting the following error:
java.lang.ClassCastException: org.apache.hadoop.io.LongWritable cannot be cast to org.apache.hadoop.io.Text
This is because the first reducer writes <Text, IntWritable>
and my second mapper is getting <Text,IntWritable>
but, as i read, mappers take <LongWritable, Text>
by default.
So, i have to set the input format with something like:
job2.setInputFormatClass(MyInputFormat.class);
Is there a way to set the InputFormat class to receive <Text,IntWritable>
?