Hey,
We can append a Scala array to another using the Concat() method. This takes the arrays as parameters- in order.
scala> var a=Array(1,2,3)
a: Array[Int] = Array(1, 2, 3)
scala> var b=Array(4,5,6)
b: Array[Int] = Array(4, 5, 6)
We’ll need to import the Array._ package:
scala> import Array._
import Array._
Now, let’s call concat():
scala> var c=concat(a,b)
c: Array[Int] = Array(1, 2, 3, 4, 5, 6)
If you want to know more about Apache Spark Scala, It's highly recommended to go for the Spark Course today.