Suppose I have a dataframe like this
val customer = Seq( ("C1", "Jackie Chan", 50, "Dayton", "M"), ("C2", "Harry Smith", 30, "Beavercreek", "M"), ("C3", "Ellen Smith", 28, "Beavercreek", "F"), ("C4", "John Chan", 26, "Dayton","M") ).toDF("cid","name","age","city","sex") How can i get cid values in one column and get the rest of the values in an array < struct < column_name, column_value > > in spark