4

For example, how would

x.foreach(rdd => rdd.cache())

be different from

x.foreachRDD(rdd => rdd.cache())

Note that x is a DStream here.

Community
  • 1
  • 1
pythonic
  • 20,589
  • 43
  • 136
  • 219

1 Answers1

2

There is no difference in work, foreach() uses foreachRDD. foreach() was deprecated and in Spark 2.0 this function is removed

T. Gawęda
  • 15,706
  • 4
  • 46
  • 61