@Override
  public int getBucket(K2 key, V2 value, int numBuckets) {
    return ObjectInspectorUtils.getBucketNumber(key.hashCode(), numBuckets);
  }
Use {@link Object#hashCode()} to partition.
ql/src/java/org/apache/hadoop/hive/ql/io/DefaultHivePartitioner.java