The following code fails with NullPointerException in RDD class on the count function:
val rdd1 = sc.parallelize(1 to 10)
val rdd2 = sc.parallelize(11 to 20)
rdd1.map{ i =>
rdd2.count
}
.foreach(println(_))
The same goes for any other action I am trying to perform inside the map
statement. I am failing to understand what I am doing wrong.
Can anyone help with this?
Thanks,
Simone Franzini, PhD
http://www.linkedin.com/in/simonefranzini
