title: PySpark - Add map function as column
body: <p>I have a pyspark DataFrame </p>
  
  <pre class="lang-python prettyprint-override"><code>a = [
      ('Bob', 562),
      ('Bob',880),
      ('Bob',380),
      ('Sue',85),
      ('Sue',963)
  ] 
  df = spark.createDataFrame(a, ["Person", "Amount"])
  </code></pre>
  
  <p>I need to create a column that hashes the <code>Amount</code> and returns the amount. The problem is I can't use a <code>UDF</code> so I have used a mapping function. </p>
  
  <pre class="lang-python prettyprint-override"><code>df.rdd.map(lambda x: hash(x["Amount"]))
  </code></pre>