O'Reilly logo
  • Kai Zhang thinks this is interesting:

input

From

Cover of Learning Spark

Note

input should not be sc.textFile(...) showed above, it should be:
val input = sc.parallelize(List(("coffee",1), ("coffee",2),("panda",3),("coffee",9)))