title: How to flatten nested lists in PySpark?
body: <p>I have an RDD structure like:</p>
  
  <pre><code>rdd = [[[1],[2],[3]], [[4],[5]], [[6]], [[7],[8],[9],[10]]]
  </code></pre>
  
  <p>and I want it to become: </p>
  
  <pre><code>rdd = [1,2,3,4,5,6,7,8,9,10]
  </code></pre>
  
  <p>How do I write a map or reduce function to make it work?</p>