title: Number of Partitions of Spark Dataframe
body: <p>Can anyone explain about the number of partitions that will be created for a  Spark Dataframe.</p>
  
  <p>I know that for a RDD, while creating it we can mention the number of partitions like below.</p>
  
  <pre><code>val RDD1 = sc.textFile("path" , 6) 
  </code></pre>
  
  <p>But for Spark dataframe while creating looks like we do not have option to specify number of partitions like for RDD.</p>
  
  <p>Only possibility i think is, after creating dataframe we can use repartition API.</p>
  
  <pre><code>df.repartition(4)
  </code></pre>
  
  <p>So can anyone please let me know if we can specify the number of partitions while creating a dataframe.</p>