title: pyspark merge two rdd together
body: <p>I have two rdd's which both are result of a groupby and look like:</p>
  
  <pre><code>[(u'1', [u'0']), (u'3', [u'1']), (u'2', [u'0']), (u'4', [u'1'])]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[(u'1', [u'3', u'4']), (u'0', [u'1', u'2'])]
  </code></pre>
  
  <p>How can I merge the two and get the following:</p>
  
  <pre><code>[(u'1', [u'0',u'3', u'4']]), (u'3', [u'1']), (u'2', [u'0']), (u'4', [u'1']),(u'0', [u'1', u'2'])]
  </code></pre>
  
  <p>I tried the join command but but that did not give me the result that I was looking for. Any help is much appreciated.</p>