title: How do I split an RDD into two or more RDDs?
body: <p>I'm looking for a way to split an RDD into two or more RDDs. The closest I've seen is <em><a href="https://stackoverflow.com/questions/27231524/scala-spark-split-collection-into-several-rdd">Scala Spark: Split collection into several RDD?</a></em> which is still a single RDD.</p>
  
  <p>If you're familiar with SAS, something like this:</p>
  
  <pre><code>data work.split1, work.split2;
      set work.preSplit;
  
      if (condition1)
          output work.split1
      else if (condition2)
          output work.split2
  run;
  </code></pre>
  
  <p>which resulted in two distinct data sets. It would have to be immediately persisted to get the results I intend...</p>