<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Spark : write ordered Dataframe to CSV in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-write-ordered-Dataframe-to-CSV/m-p/280086#M208667</link>
    <description>&lt;P&gt;I'm trying to write an &lt;STRONG&gt;ordered&lt;/STRONG&gt; Dataframe/Dataset into &lt;STRONG&gt;multiples&lt;/STRONG&gt; CSV Files, and &lt;STRONG&gt;preserve both global and local sort&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following code :&lt;/P&gt;&lt;LI-CODE lang="java"&gt;df
   .orderBy("date")
   .coalesce(100)
   .write
   .csv(...)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this code guarantee that :&lt;/P&gt;&lt;P&gt;- I will have &lt;STRONG&gt;100 output files&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- Each single CSV file is &lt;STRONG&gt;locally sorted&lt;/STRONG&gt;, I mean by the "date" column ascending&lt;BR /&gt;- &lt;STRONG&gt;Files are globally sorted&lt;/STRONG&gt;, I mean CSV part-0000 have "date" inferior to CSV part-0001, CSV part-0001 have "date" inferior to CSV part-0002 and so on ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 09:25:34 GMT</pubDate>
    <dc:creator>Plop564</dc:creator>
    <dc:date>2019-10-14T09:25:34Z</dc:date>
  </channel>
</rss>

