Nested Pivot in Spark Dataframe

spark pivot without aggregate
spark pivot multiple columns
spark pivot aggregate multiple columns
pyspark pivot multiple aggregations
spark sql pivot function
spark unpivot
spark pivot performance
pyspark stack function