You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Andrew Ash (JIRA)" <ji...@apache.org> on 2014/06/15 23:37:01 UTC
[jira] [Commented] (SPARK-2148) Document custom class as key
needing equals() AND hashcode()
[ https://issues.apache.org/jira/browse/SPARK-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14032024#comment-14032024 ]
Andrew Ash commented on SPARK-2148:
-----------------------------------
https://github.com/apache/spark/pull/1092
> Document custom class as key needing equals() AND hashcode()
> ------------------------------------------------------------
>
> Key: SPARK-2148
> URL: https://issues.apache.org/jira/browse/SPARK-2148
> Project: Spark
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 1.0.0
> Reporter: Andrew Ash
>
> 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()
--
This message was sent by Atlassian JIRA
(v6.2#6252)