title: Apache Spark: distinct doesnt work?
body: <p>Here is my code example:</p>
  
  <pre><code> case class Person(name:String,tel:String){
          def equals(that:Person):Boolean = that.name == this.name &amp;&amp; this.tel == that.tel}
  
   val persons = Array(Person("peter","139"),Person("peter","139"),Person("john","111"))
   sc.parallelize(persons).distinct.collect
  </code></pre>
  
  <p>It returns </p>
  
  <pre><code> res34: Array[Person] = Array(Person(john,111), Person(peter,139), Person(peter,139))
  </code></pre>
  
  <p>Why distinct doesn't work?I want the result as Person("john",111),Person("peter",139)</p>