cfregly
Contributor

said differently/functionally,

mapPartitions()
returns a value and does not have side effects .
forEachPartition()
does not return a value, but (typically) does have side effects.