You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Patrick Wendell (JIRA)" <ji...@apache.org> on 2014/06/16 08:35:01 UTC

[jira] [Resolved] (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:all-tabpanel ]

Patrick Wendell resolved SPARK-2148.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0
                   1.0.1

Issue resolved by pull request 1092
[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: Improvement
>          Components: Documentation
>    Affects Versions: 1.0.0
>            Reporter: Andrew Ash
>             Fix For: 1.0.1, 1.1.0
>
>
> 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)