title: How to join (FULL OUTER) two Lists in Scala?
body: <p>I have two Lists: <code>dec_tyres</code> and <code>jan_tyres</code>:</p>
  
  <pre><code>scala&gt; dec_tyres
  res21: List[(String, Int)] = List((007139::21,10), .....
  
  scala&gt; jan_tyres
  res22: List[(String, Int)] = List((005179::24,2), ..... 
  
  scala&gt; dec_tyres.length
  res19: Int = 71
  
  scala&gt; jan_tyres.length
  res20: Int = 82
  </code></pre>
  
  <p>Now to join these I'm doing:</p>
  
  <pre><code>val mb = jan_tyres.toMap
  val tyres_count = dec_tyres.flatMap{case (ka,va) =&gt; mb.get(ka).map(vb =&gt; (ka,va,vb))}.toList
  </code></pre>
  
  <p>Which gives me:</p>
  
  <pre><code>scala&gt; tyres_count
  res23: List[(String, Int, Int)] = List((007139::21,10,8), .....
  
  scala&gt; tyres_count.length
  res24: Int = 53
  </code></pre>
  
  <p>This is computing an inner join and giving me only 53 records, where I'm expecting 100 records.</p>
  
  <p>All the records where both of the <code>dec_tyres</code> and <code>jan_tyres</code> do not have a common key are scraped. Instead I want that record with the particular key instead a zero as the respective value.</p>
  
  <p>The solution is hence a "Full Outer Join", which I'm really struggling with.</p>