title: How to merge two dataframes spark java/scala based on a column?
body: <p>I have a two dataframes DF1 and DF2 with <strong>id</strong> as the unique column,
  DF2 may contain a new records and updated values for existing records of DF1, when we merge the two dataframes result should include the new record and a old records with updated values remain should come as it is.</p>
  
  <p>Input example:</p>
  
  <pre><code>id   name
  10   abc
  20   tuv
  30   xyz
  </code></pre>
  
  <p>and</p>
  
  <pre><code>id   name
  10   abc
  20   pqr
  40   lmn
  </code></pre>
  
  <p>When I merge these two dataframes, I want the result as:</p>
  
  <pre><code>id   name
  10   abc
  20   pqr
  30   xyz
  40   lmn
  </code></pre>