title: How to save files to Parquet with Spark so that header is ready/available during reads?
body: <p>I am reading data using Spark ('2.4.3' version) from S3 location (folder) where files are saved as <code>csv.gz</code>.</p>
  
  <p>First line is a header. </p>
  
  <p>If I just read files as <code>df = spark.read.csv("s3://myfolder")</code> and save as <code>df.write.mode("overwrite").parquet(write_folder)</code> -> files are written as Parquet files but when reading them back to some DF - columns are not identified by default (e.g. <code>df.columns</code> shows <code>_c0, _c1...</code>).</p>
  
  <p>What is the proper way to save file to Parquet so that column names are ready when reading parquet files later? </p>
  
  <p>I am trying to avoid infer schema (or any other gymnastics) during reading from parquet if possible.</p>