title: Saving empty DataFrame with known schema (Spark 2.2.1)
body: <p>Is it possible to save an empty DataFrame with a known schema such that the schema is written to the file, even though it has 0 records?</p>
  
  <pre><code>def example(spark: SparkSession, path: String, schema: StructType) = { 
    val dataframe = spark.createDataFrame(spark.sparkContext.emptyRDD[Row], schema) 
    val dataframeWriter = dataframe.write.mode(SaveMode.Overwrite).format("parquet") 
    dataframeWriter.save(path) 
  
    spark.read.load(path) // ERROR!! No files to read, so schema unknown 
  } 
  </code></pre>