How to pivot table in pyspark February 08, 2023 Get link Facebook X Pinterest Email Other Apps How to pivot table in pysparkdf= spark.read.format("csv").option("header","True").load("file:///home/cloudera/product.csv")df.show()dff = df.groupBy("PRODUCT_KEY").pivot("YEAR").agg(first("volume"))dff.show() Comments
Comments
Post a Comment