Re: What's the use of RangePartitioner.hashCode

2016-09-24 Thread WangJianfei
thank you! -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/What-s-the-use-of-RangePartitioner-hashCode-tp18953p19037.html Sent from the Apache Spark Developers List mailing list archive at Nabble.com. --

Re: What's the use of RangePartitioner.hashCode

2016-09-22 Thread Jakob Odersky
Hash codes should try to avoid collisions of objects that are not equal. Integer overflowing is not an issue by itself On Wed, Sep 21, 2016 at 10:49 PM, WangJianfei wrote: > Than you very much sir! but what i want to know is whether the hashcode > overflow will make a trouble. thank you! > > > >

Re: What's the use of RangePartitioner.hashCode

2016-09-21 Thread WangJianfei
Than you very much sir! but what i want to know is whether the hashcode overflow will make a trouble. thank you! -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/What-s-the-use-of-RangePartitioner-hashCode-tp18953p18996.html Sent from the Apache Spark

Re: What's the use of RangePartitioner.hashCode

2016-09-21 Thread Jakob Odersky
sday, September 21, 2016 15:12 > Subject: Re: What's the use of RangePartitioner.hashCode > To: WangJianfei > Cc: dev > > > > Hi, > It is used jointly with a custom implementation of the `equals` > method. In Scala, you can override the `equals` method to change th

Re: What's the use of RangePartitioner.hashCode

2016-09-21 Thread Andrew Duffy
11/07/java-equals-and-hashcode-contract/ _ From: Jakob Odersky Sent: Wednesday, September 21, 2016 15:12 Subject: Re: What's the use of RangePartitioner.hashCode To: WangJianfei Cc: dev Hi, It is used jointly with a custom implementation of t

Re: What's the use of RangePartitioner.hashCode

2016-09-21 Thread Jakob Odersky
Hi, It is used jointly with a custom implementation of the `equals` method. In Scala, you can override the `equals` method to change the behaviour of `==` comparison. On example of this would be to compare classes based on their parameter values (i.e. what case classes do). Partitioners aren't case