title: Adding a Column in DataFrame from another column of same dataFrame Pyspark
body: <p>I have a Pyspark dataframe <code>df</code>, like following:</p>
  
  <pre><code>+---+----+---+
  | id|name|  c|
  +---+----+---+
  |  1|   a|  5|
  |  2|   b|  4|
  |  3|   c|  2|
  |  4|   d|  3|
  |  5|   e|  1|
  +---+----+---+
  </code></pre>
  
  <p>I want to add a column <code>match_name</code> that have value from the <code>name</code> column where <code>id == c</code></p>
  
  <p>Is it possible to do it with function <code>withColumn()</code>?</p>
  
  <p>Currently i have to create two dataframes and then perform join.
  Which is inefficient on large dataset.</p>
  
  <p>Expected Output:</p>
  
  <pre><code>+---+----+---+----------+
  | id|name|  c|match_name|
  +---+----+---+----------+
  |  1|   a|  5|         e|
  |  2|   b|  4|         d|
  |  3|   c|  2|         b|
  |  4|   d|  3|         c|
  |  5|   e|  1|         a|
  +---+----+---+----------+
  </code></pre>