I get a warning when using an RDD in a for comprension, and I'm not sure if it's something I'm doing wrong. If I do this:
val sc = new SparkContext(...)
val anRDD = sc.parallelize(List(
("a", List(1, 2, 3)),
("b", List(4),
("c", List(5, 6))
)
for {
(someString, listOfInts) <- anRDD
someInt <- listOfInts
} yield (someString, someInt)
Then I get this output:
warning: `withFilter' method does not yet exist on org.apache.spark.rdd.RDD[(String, List[Int])], using `filter' method instead
(s, li) <- rl
But it does still successfully return a FlatMappedRDD[(String, Int)]. Am I doing something wrong? Or is it safe to ignore this warning?
Update: I would also accept as an answer how the for-comprehension converts these operations to map/flatMap/filter calls, since I didn't think there'd be any filter or withFilter calls required. I assumed it would be equivalent to something similar to this:
anRDD.flatMap(tuple => tuple.map(someInt => (tuple._1, someInt)))
But this doesn't include any filter or withFilter calls, which seems to be the source of the warning.
Oh, I'm using Spark 1.2.0, Scala 2.10.4, and this is all within the REPL.