How to explode the dataframe via pyspark February 05, 2023 Get link Facebook X Pinterest Email Other Apps How to explode the dataframe via pysparkInput:Output:Solution:df = spark.read.format("csv").option("header","True").load("file:///home/cloudera/country.csv")df.show(truncate=False)dfp = df.withColumn("country",explode(split("country",",")))dfp.show() Comments
Comments
Post a Comment