The Spark documentation shows how to create a DataFrame from an RDD, using Scala case classes to infer a schema. I am trying to reproduce this concept using sqlContext
sqlContext
You can create a DataFrame directly from a Seq of case class instances using toDF as follows:
DataFrame
Seq
toDF
val dogDf = Seq(Dog("Rex"), Dog("Fido")).toDF