hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko Bauhardt ...@101tec.com>
Subject IntWritable.Comparator
Date Thu, 17 Aug 2006 16:00:16 GMT
Hi developers,
i had wrote a mapred job with  OutputKeyClass IntWritable. But the  
keys are not not correct sorted in the output file. I look at the  
code from the Intwritable.Comparator and i am confused.

Currently the compare-method returns:
return thisValue - thatValue;

But what is, if "thisValue" has the value Integer.MIN_VALUE+1 and the  
"thatValue" has the value 2. The result of the method are return  
2147483647. In that case the compare method says that "thisValue" is  
greater than "thatValue".

The method should be return like that:
thisValue < thatValue ? -1 : thisValue == thatValue ? 0 : 1;


Or overlook i something?

Regards,
Marko


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message