title: Apply function to each row of Spark DataFrame
body: <p>I'm on Spark 1.3.</p>
  
  <p>I would like to apply a function to each row of a dataframe. This function hashes each column of the row and returns a list of the hashes.</p>
  
  <pre><code>dataframe.map(row =&gt; row.toSeq.map(col =&gt; col.hashCode))
  </code></pre>
  
  <p>I get a NullPointerException when I run this code. I assume that this is related to <a href="https://issues.apache.org/jira/browse/SPARK-5063" rel="noreferrer">SPARK-5063</a>.</p>
  
  <p>I can't think of a way to achieve the same result without using a nested map.</p>