title: How to join three RDDs in to a tuple?
body: <p>I am relatively new to Apache Spark in Python, and here is what I am trying to do. I have input data as following.</p>
  
  <ul>
  <li><code>rdd_row</code> is a RDD of row indices (i),</li>
  <li><code>rdd_col</code> is a RDD of column indices (j), </li>
  <li><code>rdd_values</code> is a RDD of Values (v).</li>
  </ul>
  
  <p>The above three RDDs are huge.</p>
  
  <p>I am trying to convert them to a sparse rdd matrix</p>
  
  <pre><code>rdd_mat= ([rdd_row],[rdd_col],[rdd_values])
  </code></pre>
  
  <p>i.e, </p>
  
  <pre><code>rdd_mat=([i1,i2,i3 ..],[j1,j2,j3..], [v1,v2,v3 ..])
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>zip where rdd_row.zip(rdd_col).zip(rdd_val) 
  </code></pre>
  
  <p>but it ends up giving </p>
  
  <pre><code>[(i1,j1,v1),(i2,j2,v2) ..]
  </code></pre>
  
  <p>and </p>
  
  <pre><code>rdd1.union(rdd2) 
  </code></pre>
  
  <p>won't create a tuple.</p>
  
  <p>Help guiding me in the right direction is much appreciated!</p>