title: How to convert spark SchemaRDD into RDD of my case class?
body: <p>In the spark docs it's clear how to create parquet files from <code>RDD</code> of your own case classes; (from the docs)</p>
  
  <pre class="lang-scala prettyprint-override"><code>val people: RDD[Person] = ??? // An RDD of case class objects, from the previous example.
  
  // The RDD is implicitly converted to a SchemaRDD by createSchemaRDD, allowing it to be stored using Parquet.
  people.saveAsParquetFile("people.parquet")
  </code></pre>
  
  <p>But not clear how to convert back, really we want a method <code>readParquetFile</code> where we can do:</p>
  
  <pre class="lang-scala prettyprint-override"><code>val people: RDD[Person] = sc.readParquestFile[Person](path)
  </code></pre>
  
  <p>where those values of the case class are defined are those which are read by the method.</p>