1

I am seeing something funny here when comparing case objects after they go through a RDD. The code is very simple.

trait Foo

case object Gee extends Foo
case object Bar extends Foo

val ys = List(Gee, Gee, Bar)
val xs = sc.parallelize(List(Gee, Gee, Bar))

Now this is weird.

xs.filter { x => x == Gee }.collect

Gives

res: Array[Product with Serializable with Foo] = Array()

While

ys.filter { x => x == Gee }

gives

res: List[Product with Serializable with Foo] = List(Gee, Gee)

0 Answers0