title: Spark - Divide a dataframe into n number of records
body: <p>I have a dataframe with 2 or more columns and 1000 records. I want to split the data into 100 records chunks randomly without any conditions.</p>
  
  <p>So expected output in records count should be something like this,</p>
  
  <p><code>[(1,2....100),(101,102,103...200),.....,(900,901...1000)]</code></p>
  
  <p><strong>Here's the solution that worked for my use case after trying different approaches:</strong></p>
  
  <p><a href="https://stackoverflow.com/a/61276734/12322995">https://stackoverflow.com/a/61276734/12322995</a></p>