title: Python Apache Beam - Join two Pcollections when the key of one collection is a subkey of the other collections key
body: <p>I have a situation like this:</p>
  
  <p>My first Pcollection is of the form:</p>
  
  <pre><code>(ID1): (status)
  </code></pre>
  
  <p>and my second collection is of the form:</p>
  
  <p><code>(ID1, ID2): (score1, score2)</code></p>
  
  <p>I need to join them so that I have</p>
  
  <pre><code>(ID1, ID2): (score1, score2, status)
  </code></pre>
  
  <p>i.e. I want to join them on <code>ID1</code> independent of <code>ID2</code>. How would I go about this? Should I recast my second collection to</p>
  
  <pre><code>(ID1): (ID2, score1, score2)
  </code></pre>
  
  <p>first and then join them with CoGroupByKey() ? If so, how do I recast the key/value so that one part of the key is moved to the value?</p>
  
  <p>Thanks in advance</p>