I have a Dataframe containing 3 columns
| str1 | array_of_str1 | array_of_str2 |
+-----------+----------------------+----------------+
| John | [Size, Color] | [M, Black] |
| Tom | [Size, Color] | [L, White] |
| Matteo | [Size, Color] | [M, Red] |
I want to add the Array column that contains the 3 columns in a struct type
| str1 | array_of_str1 | array_of_str2 | concat_result |
+-----------+----------------------+----------------+-----------------------------------------------+
| John | [Size, Color] | [M, Black] | [[[John, Size , M], [John, Color, Black]]] |
| Tom | [Size, Color] | [L, White] | [[[Tom, Size , L], [Tom, Color, White]]] |
| Matteo | [Size, Color] | [M, Red] | [[[Matteo, Size , M], [Matteo, Color, Red]]] |
AdditionalAttribute, is this a field-name of the columnconcat_result? is your spark 2.4+ or below?AdditionalAttributeis your desired column name, notconcat_resultshown in your post? and the new column has a schema of array of structs with 3 string fields?