score:-1

You could use collect_list to convert it back to array in this manner (column names are just a suggestion:)

import org.apache.spark.sql.functions._ 
augmented = df.groupBy("id").agg(collect_list("exploded").as("array"))

Related Query

More Query from same tag