title: How can you store the results from a forEach in Spark
body: <p><code>DataSet#foreach(f)</code> applies the function <code>f</code> to each row in the dataset. In a clustered environment, the data is split across the cluster. How can the results from each of these functions be collected? </p>
  
  <p>For example, say the function would count the number of characters stored in each row. How can you create a DataSet or RDD that contains the results of each of these functions applied to each row?</p>