json array file explode like below output in pyspark February 05, 2023 Get link Facebook X Pinterest Email Other Apps json array file explode like below output in pysparkSolution:df = spark.read.format("json").load("file:////home/cloudera/testxxx/listOfFruit.json")df.show(truncate=False)dfp= df.withColumn("list_of_fruit",explode("list_of_fruit"))dfp.show() Comments
Comments
Post a Comment