scala> ok
res58: Array[String] = Array(Bayern Munich,7, Borussia Dortmund,5, Arsenal,3, Schalke 04,2, SC Freiburg,1, Hannover 96,1, Lazio,1, Chelsea,1, Borussia Mönchengladbach,1, Real Madrid,1)
scala> val df = sc.parallelize(ok).toDF("Arr_string")
scala> val df1 = df.withColumn("_tmp", split($"Arr_string", ",")).select(
| $"_tmp".getItem(0).as("Name"),
| $"_tmp".getItem(1).as("Number")
| ).drop("_tmp")
scala> df1.show(false)
+------------------------+------+
|Name |Number|
+------------------------+------+
|Bayern Munich |7 |
|Borussia Dortmund |5 |
|Arsenal |3 |
|Schalke 04 |2 |
|SC Freiburg |1 |
|Hannover 96 |1 |
|Lazio |1 |
|Chelsea |1 |
|Borussia Mönchengladbach|1 |
|Real Madrid |1 |
+------------------------+------+
scala> df1.write.format("json").save(<path of parent json dir>)