title: Null value Left Outer Join in Spark
body: <p>I have two RDD and got the left join</p>
  
  <p>left join <code>p1.leftOuterJoin(p2)</code> the result is like:</p>
  
  <pre><code>Array[((String, String), (Int, Option[Int]))] = 
  Array(((1001-150329-002-0-04624,5060567),(1,None)), ((1002-141105-008-0-01934,10145500),(1,None)), ((1013-150324-009-0-02270,15750046),(1,None)), ((1005-150814-005-0-05885,5060656),(1,Some(1))), ((1009-150318-004-0-02537,5060583),(1,None)))
  </code></pre>
  
  <p>I want to replace all <code>None</code> with <code>0</code> and get a clean data set like:</p>
  
  <pre><code>Array(((1001-150329-002-0-04624,5060567),0), ((1002-141105-008-0-01934,10145500),0), ((1013-150324-009-0-02270,15750046),0), ((1005-150814-005-0-05885,5060656),1)), ((1009-150318-004-0-02537,5060583),0))
  </code></pre>
  
  <p>Basically replace all <code>(1,None)</code> with <code>0</code> and <code>(1,Some(1))</code> with <code>1</code></p>