title: Difference between a map and udf
body: <p>When I work with DataFrames in Spark, I have to sometimes edit only the values of a particular column in that DataFrame. For eg. if I have a <code>count</code> field in my dataframe, and If I would like to add <code>1</code> to every value of <code>count</code>, then I could either write a custom udf to get the job done using the <code>withColumn</code> feature of DataFrames, or I could do a <code>map</code> on the DataFrame and then extract another DataFrame from the resultant RDD. </p>
  
  <p>What I would like to know is how a udf actually works under the hood. Give me a comparison in using a map/udf in this case. What's the performance difference?</p>
  
  <p>Thanks!</p>