Combining values in array in scala

val ar=array(“Hello”,“one”,“lib”)

scala> val bb=ar.collect.mkString(" “)
:25: error: value collect is not a member of org.apache.spark.sql.Column
val bb=ar.collect.mkString(” ")

any idea what modification i have to do here to combine ?

Please try the below code.

  val ar = Array("Hello","one","lib")
  val string = ar.mkString(" ")