title: repartitioning by multiple columns for Pyspark dataframe
body: <p>EDIT: adding more context to the question now that I reread the post again:</p>
  <p>Let's say I have a pyspark dataframe that I am working with and currently I can repartition the dataframe as such:</p>
  <pre><code>dataframe.repartition(200, col_name)
  </code></pre>
  <p>And I write that partitioned dataframe out to a parquet file. When reading the directory, I see that the directory in the warehouse is partitioned the way I want:</p>
  <pre><code>/apps/hive/warehouse/db/DATE/col_name=1
  /apps/hive/warehouse/db/DATE/col_name=2
  </code></pre>
  <p>I want to understand how I can repartition this in multiple layers, meaning I partition one column for the top level partition, a second column for the second level partition, and a third column for the third level partition. Is it as easy as adding a partitionBy() to a write method?</p>
  <pre><code>dataframe.mode(&quot;overwrite&quot;).partitionBy(&quot;col_name1&quot;,&quot;col_name2&quot;,&quot;col_name3&quot;)
  </code></pre>
  <p>Thus creating the directories as such?</p>
  <pre><code>/apps/hive/warehouse/db/DATE/col_name1=1
  |---------------------------------------&gt;/col_name2=1
  |---------------------------------------------------&gt;/col_name3=1
  </code></pre>
  <p>If so, can I use a partitionBy() to write out a max number of files per partition?</p>