title: How to Drop a Duplicates Column in dataframe while retaining the Unique Column including the only one column among duplicates
body: <p>I am trying to drop the duplicate column while retaining only the unique columns and only one column among the duplicates after joining.</p>
  
  <p>For Example:
  Duplicate DataFrame</p>
  
  <pre><code>root
  |-- id: string (nullable = true)
  |-- name: string (nullable = true)
  |-- loc: string (nullable = true)
  |-- sal: string (nullable = true)
  |-- name: string (nullable = true)
  |-- loc: string (nullable = true)
  |-- sal: string (nullable = true)
  
  
  After removing duplicates, the output should be
  
  root
  |-- id: string (nullable = true)
  |-- name: string (nullable = true)
  |-- loc: string (nullable = true)
  |-- sal: string (nullable = true)
  </code></pre>
  
  <p>Any help will be appreciated?</p>