Adding struct type value into existing column of data frame

Hi,

Have a spark dataframe as below schema
customer_id String
home_address struct<addres_1:string,address_2:string,active_date:string, deactive_date:string> **
home_address_history array<home_address>

  1. for each row, whatever the home_address struct need to add in array as first element and also I need to assign local date to active_date which is sud field in the struct.

I need to read the array<home_address> elements into array before
adding the home_address and update the zeroth element deactive_dt to local date and add to the array<home_Address>

can you please suggest how to achieve in the Spark Scala programming.