title: Applying Mapping Function on DataFrame
body: <p>I have just started using databricks/pyspark. Im using python/spark 2.1. I have uploaded data to a table. This table is a single column full of strings. I wish to apply a mapping function to each element in the column. I load the table into a dataframe:</p>
  
  <pre><code>df = spark.table("mynewtable")
  </code></pre>
  
  <p>The only way I could see was others saying was to convert it to RDD to apply the mapping function and then back to dataframe to show the data. But this throws up job aborted stage failure:</p>
  
  <pre><code>df2 = df.select("_c0").rdd.flatMap(lambda x: x.append("anything")).toDF()
  </code></pre>
  
  <p>All i want to do is just apply any sort of map function to my data in the table.
  For example append something to each string in the column, or perform a split on a char, and then put that back into a dataframe so i can .show() or display it.  </p>