title: Is there a way to take the first 1000 rows of a Spark Dataframe?
body: <p>I am using the <code>randomSplit</code>function to get a small amount of a dataframe to use in dev purposes and I end up just taking the first df that is returned by this function.</p>
  
  <pre><code>val df_subset = data.randomSplit(Array(0.00000001, 0.01), seed = 12345)(0)
  </code></pre>
  
  <p>If I use <code>df.take(1000)</code> then I end up with an array of rows- not a dataframe, so that won't work for me.</p>
  
  <p>Is there a better, simpler way to take say the first 1000 rows of the df and store it as another df?</p>