score:3

Accepted answer
  1. parse the JSON using from_json
  2. cast it to MapType(StringType, StringType)
  3. extract only values using map_values
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.{MapType, StringType}

movieDF.select("wiki_mv_id","mv_nm","mv_genre")
      .withColumn("genre_frmttd",map_values(from_json(col("mv_genre"),MapType(StringType, StringType))))
      .show(1,false)

Related Query

More Query from same tag