RDD.
foreach
Applies a function to all elements of this RDD.
New in version 0.7.0.
a function applied to each element
See also
RDD.foreachPartition()
pyspark.sql.DataFrame.foreach()
pyspark.sql.DataFrame.foreachPartition()
Examples
>>> def f(x): print(x) ... >>> sc.parallelize([1, 2, 3, 4, 5]).foreach(f)
previous
pyspark.RDD.foldByKey
next
pyspark.RDD.foreachPartition