I am a bit stuck trying to convert RDD[Array[Byte]] into Array[Byte]. I have the following where I am first extracting the RDD[Array[Byte]] from a previously defined tuple in the form of RDD(String, Array[Byte]):
val extractArrayFromRDD: RDD[Array[Byte]] = rdd.map(t => t._2)
I then can really only get the first element of the array, as follows:
val rddToBytes: Array[Byte] = extractArrayFromRDD.first()
However, I indeed need to be returned with the entire Array, but I do not seem to find a way to do it. Any idea?
Thank you