cloudera/crunch — pull request #7 by gabrielreid (2012-03-07 15:35:36+00:00)
Title: TupleWritablePartitioner and AvroIndexedRecordPartitioner return invalid partition numbers

The TupleWritablePartitioner and AvroIndexedRecordPartitioner partitioners in JoinUtils are dependent on the hashCode of the input key to calculate a partition value. However, if the hashCode is negative then an invalid (negative) partition number is created by both partitioners.

The included commit contains unit tests that demonstrate the issue, as well as fixes for both partitioners.