title: How to update an array column?
body: <p>I know we can replace values in a dataframe column and return a new dataframe with updated values using below method :</p>
  
  <pre><code>dataframe.withColumn("col1",when(col("col1").equalTo("this"),"that").otherwise(col("make")))
  </code></pre>
  
  <p>but this will change the whole column value wherever required.</p>
  
  <p>Now I have a slightly complex dataframe:</p>
  
  <pre><code>|        colleagues|   name|
  
  |[guy1, guy2, guy3]|Thisguy|
  |[guy4, guy5, guy6]|Thatguy|
  |[guy7, guy8, guy9]|Someguy|
  </code></pre>
  
  <p>Here I have a 'colleagues' column which holds arrays. And I want to replace a specific element of any array, e.g instead of 'guy2' in the first row I want 'guy10' in my new dataframe
  How can I achieve that? Please help.</p>