I am trying to convert Array of Strings to byte-array in Spark and re-converting the byte-array to Array of Strings.
However, I am not getting the String array back
you take a list of strings and and treat it as a single object and at the conversion back you treat it as if was just a string- if you want a single string back you also need to convert the list to a string:
val convertToByteArray = udf((map: Seq[String]) => mapper.writeValueAsBytes(map.mkString("[",",","]")))