title: Spark avro to parquet
body: <p>I have a stream of avro formatted data (json encoded) which needs to be stored as parquet files. I could only do this,</p>
  
  <pre><code>val df = sqc.read.json(jsonRDD).toDF()
  </code></pre>
  
  <p>and write the df as parquet.</p>
  
  <p>Here the schema is inferred form the json. But i already have the avsc file and I don't want spark to infer the schema from the json.</p>
  
  <p>And in the above mentioned way the parquet files store the schema info as StructType and not as avro.record.type. Is there a way to store the avro schema information as well.  </p>
  
  <p>SPARK - 1.4.1</p>