I have implemented WritableComparable for my map job and have passed three values to it.
public class KeyCustom implementsw WritableComparable<KeyCustom>
{
private Text placeOfBirth;
private Text country;
private LongWritable age;
//Implemented constructors and set methods, write, readFields, hashCode and equals
@Override
public int compareTo(KeyCustom arg0)
{
return placeOfBirth.compareTo(arg0.placeOfBirth);
}
}
But then when I log these three fields in my reducer I can clearly see that all the people with the same country are being grouped together. It would be great if someone could help me out so that all my reducers get the people with the same place of birth. I dont' know how to do this or if my compareTo function is wrong.
Thanks for all the help.