2

I am new to Spark and Scala and came with a time consuming dilema:

case class Greeting( expr: String )
val lg = List(Greeting("Hello"), Greeting("Hej"))
val rg = sc.parallelize(lg)
rg.intersection(rg).count

I get 0 as the result!

What am I missing here?

Thank you for your kind support.

Aggregator
  • 21
  • 1
  • Thanks for your response. I read somewhere that one of the ideas of using case clase constructs is to have an equals implementation out of the box. I noticed an example like this works with Integer instead of Greeting. So I am still confused. – Aggregator May 04 '16 at 16:16
  • val ri = sc.parallelize( List(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) ); ri.intersection(ri).count; returns 10. – Aggregator May 04 '16 at 16:23

0 Answers0