title: Saving ordered dataframe in Spark
body: <p>I'm trying to save ordered dataframe into HDFS. My code looks like this:</p>
  
  <pre><code>dataFrame.orderBy("index").write().mode(SaveMode.Overwrite).parquet(getPath());
  </code></pre>
  
  <p>I run same code on two different clusters, one cluster uses Spark 1.5.0, another - 1.6.0. When running on cluster with Spark 1.5.0 it does not preserve sorting after saving on disc.</p>
  
  <p>Is there any specific cluster settings to preserve sorting during saving data on disc? or is it a known problem of the spark version? I've searched spark documentation but couldn't find any info about.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've checked files in parquet and in both cases files are sorted. So problem occures while reading, Spark 1.5.0 doesn't preserve ordering while reading and 1.6.0 does.</p>
  
  <p><strong>So my question now:</strong> Is it possible to read sorted file and preserve ordering in Spark 1.5.0?</p>