Oh that's brilliant. Thanks a lot Brock!
On 9/19/2011 3:15 PM, Brock Noland wrote:
Hi,
On Mon, Sep 19, 2011 at 3:19 PM, Shi Yu<[email protected]> wrote:
I am stuck again in a probably very simple problem. I couldn't generate the
map output in sequence file format. I always get this error:
java.io.IOException: wrong key class: org.apache.hadoop.io.Text is not class
org.apache.hadoop.io.LongWritable
No worries.
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(Text.class);
You are running a map only job, so I think you want:
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
Yes, that was the exact reason.
But I also recommend adding @Override on your map method because it's
easy to accidentally not override your superclass method.
@Override
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException{
Brock