Hi Gang, What's your reduce output key type? It looks like you're using Text instead of IntWritable, causing your keys to be sorted lexicographically instead of numerically.
Sorting is done with a comparator that defines how an arbitrary element compares to another. Hashing serves a different purpose. Ed On Sun, Feb 28, 2010 at 4:23 PM, Gang Luo <[email protected]> wrote: > Hi all, > here is a wired observation. The keys in the result of *ONE* reducer are > ordered like this: > 18166 > 18169 > 1817 > 18171 > 18172 > > why is key "1817" comes after "18169"? It makes sense if that key is "18170" > but it isn't! Why does it happen and basically, how does hadoop tell key1 is > larger than key2? Compare their hash codes? > > Thanks. > -Gang > > > > >
