title: Add each element of an RDD to each element of another RDD in spark scala.
body: <p>I have two RDDs with following structure</p>
  
  <pre><code>org.apache.spark.rdd.RDD[(Long, Double)]
  </code></pre>
  
  <p>Here each row of RDD contains an index <code>Long</code> and a value <code>Double</code>. I want to add each element of an RDD to each element of other RDD in spark scala.  </p>
  
  <p>An example would look like this:</p>
  
  <p>RDD1:</p>
  
  <pre><code>Array[(Long, Double)] = Array((0,-3),(1,2))
  </code></pre>
  
  <p>RDD2:</p>
  
  <pre><code>Array[(Long, Double)] = Array((0,4),(1,-2))
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Array[(Long, Double)] = Array((0,1),(0,-5),(1,6),(1,0))
  </code></pre>