Based on How to convert column of arrays of strings to strings?.
Module: Spark SQL
val words = Seq(Array("hello", "world")).toDF("words")
scala> words.show
+--------------+
| words|
+--------------+
|[hello, world]|
+--------------+
scala> words.printSchema
root
|-- words: array (nullable = true)
| |-- element: string (containsNull = true)
scala> solution.show
+--------------+-----------+
| words| solution|
+--------------+-----------+
|[hello, world]|hello world|
+--------------+-----------+
scala> solution.printSchema
root
|-- words: array (nullable = true)
| |-- element: string (containsNull = true)
|-- solution: string (nullable = false)
Duration: 15 mins