title: Spark assign value if null to column (python)
body: <p>Assuming that I have the following data</p>
  
  <pre><code>+--------------------+-----+--------------------+
  |              values|count|             values2|
  +--------------------+-----+--------------------+
  |              aaaaaa|  249|                null|
  |              bbbbbb|  166|                  b2|
  |              cccccc| 1680|           something|
  +--------------------+-----+--------------------+
  </code></pre>
  
  <p>So if there is a null value in <code>values2</code> column how to assign the <code>values1</code> column to it? So the result should be:</p>
  
  <pre><code>+--------------------+-----+--------------------+
  |              values|count|             values2|
  +--------------------+-----+--------------------+
  |              aaaaaa|  249|              aaaaaa|
  |              bbbbbb|  166|                  b2|
  |              cccccc| 1680|           something|
  +--------------------+-----+--------------------+
  </code></pre>
  
  <p>I thought of something of the following but it doesnt work:</p>
  
  <pre><code>df.na.fill({"values2":df['values']}).show()
  </code></pre>
  
  <p>I found this way to solve it but there should be something more clear forward:</p>
  
  <pre><code>def change_null_values(a,b):
      if b:
          return b
      else:
          return a
  
  udf_change_null = udf(change_null_values,StringType())
  
  df.withColumn("values2",udf_change_null("values","values2")).show()
  </code></pre>