Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0
-
None
Description
Several support requests on user@ have been tracked down to using a custom class as the key in a groupByKey() or reduceByKey() that has a custom equals() method but not the corresponding custom hashCode() method.
Let's add a note in the documentation that custom keys need both equals() and hashCode() overridden, never just equals()
The right place for this addition might be as a sub-section or note in http://spark.apache.org/docs/latest/programming-guide.html#working-with-key-value-pairs
It should probably include a link to http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()