FAQ
Hi,
On Mon, Sep 19, 2011 at 3:19 PM, Shi Yu 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);

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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupcommon-user @
categorieshadoop
postedSep 19, '11 at 7:19p
activeSep 19, '11 at 8:27p
posts3
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Shi Yu: 2 posts Brock Noland: 1 post

People

Translate

site design / logo © 2022 Grokbase