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

Switch to Threaded View
Hadoop >> mail # user >> old problem: mapper output as sequence file

Copy link to this message
Re: old problem: mapper output as sequence file

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:


But I also recommend adding @Override on your map method because it's
easy to accidentally not override your superclass method.

          public void map(LongWritable key, Text value, Context context)
         throws IOException, InterruptedException{