title: pySpark forEach function on a key
body: <p>I can't seem to find much documentation on forEach. I have a dataset that is in key/value pairing. I am looking to do something like (pseudo code):</p>
  
  <p>forEach key, sum the value
  forEach key, max of the values
  etc. </p>