Where to find subtractByKey in RDD


#1

I couldn’t find subtractByKey method definition in RDD https://spark.apache.org/docs/1.6.0/api/scala/index.html#org.apache.spark.rdd.RDD.

However, it is available in b from following definition. How??

val a = sc.parallelize(List(“dog”, “tiger”, “lion”, “cat”, “spider”, “eagle”), 2)
val b = a.keyBy(.length)
val c = sc.parallelize(List(“ant”, “falcon”, “squid”), 2)
val d = c.keyBy(
.length)

b.subtractByKey(d)