title: Merging Dataframes in Spark
body: <p>I've 2 Dataframes, say A &amp; B. I would like to join them on a key column &amp; create another Dataframe. When the keys match in A &amp; B, I need to get the row from B, not from A.</p>
  
  <p>For example:</p>
  
  <p>DataFrame A:</p>
  
  <pre><code>Employee1, salary100
  Employee2, salary50
  Employee3, salary200
  </code></pre>
  
  <p>DataFrame B</p>
  
  <pre><code>Employee1, salary150
  Employee2, salary100
  Employee4, salary300
  </code></pre>
  
  <p>The resulting DataFrame should be:</p>
  
  <p>DataFrame C:</p>
  
  <pre><code>Employee1, salary150
  Employee2, salary100
  Employee3, salary200
  Employee4, salary300
  </code></pre>
  
  <p>How can I do this in Spark &amp; Scala?</p>