title: How to write RDD[String] to parquet file with schema inference?
body: <p>My <code>Spark Streaming</code> job needs to handle a <code>RDD[String]</code> where String corresponds to a row of a <code>csv</code> file. I don't know the schema beforehand so <strong>I need to infer the schema</strong> from the RDD then write its content to a <code>parquet</code> file. If I was reading a <code>csv</code> file from disk, I could just load everything into a <code>DataFrame</code> with schema inference and write it to parquet straight away. In my scenario though, my starting point is a <code>RDD[String]</code> that I get as a result of a stream.</p>