title: How to pivot Spark DataFrame?
body: <p>I am starting to use Spark DataFrames and I need to be able to pivot the data to create multiple columns out of 1 column with multiple rows.  There is built in functionality for that in Scalding and I believe in Pandas in Python, but I can't find anything for the new Spark Dataframe.</p>
  <p>I assume I can write custom function of some sort that will do this but I'm not even sure how to start, especially since I am a novice with Spark.  If anyone knows how to do this with built-in functionality or suggestions for how to write something in Scala, it is greatly appreciated.</p>