You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Larry Homes <la...@gmail.com> on 2010/02/24 21:30:48 UTC

Hadoop key mismatch

Hello,

I am trying to sort some values by using a simple map and reduce
without any processing, but I think I messed up my data types somehow.

Rather than try to paste code in an email, I have described the
problem and pasted all the code (nicely formatted) here:
http://www.coderanch.com/t/484435/Distributed-Java/java/Hadoop-key-mismatch

Thanks

Re: Hadoop key mismatch

Posted by Edward Capriolo <ed...@gmail.com>.
On Wed, Feb 24, 2010 at 3:30 PM, Larry Homes <la...@gmail.com> wrote:
> Hello,
>
> I am trying to sort some values by using a simple map and reduce
> without any processing, but I think I messed up my data types somehow.
>
> Rather than try to paste code in an email, I have described the
> problem and pasted all the code (nicely formatted) here:
> http://www.coderanch.com/t/484435/Distributed-Java/java/Hadoop-key-mismatch
>
> Thanks
>

I think the first problem you are having is that you changed the
signature of the map method incorrectly.

 public void map(Text key, Text value, Context context)

The type of key should be LongWritable. Key is an integer representing
the offset of the line. Value is the entire line of text.

Try :
public void map(LongWritable key, Text value, Context context)

Adjust accordingly and you should be ok. (at least until the next problem :)