Derive multiple columns from a single column in a Spark DataFrame

后端 未结 5 1848
鱼传尺愫
鱼传尺愫 2020-11-28 02:09

I have a DF with a huge parseable metadata as a single string column in a Dataframe, lets call it DFA, with ColmnA.

I would like to break this column, ColmnA into mu

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 02:59

    This can be easily achieved by using pivot function

    df4.groupBy("year").pivot("course").sum("earnings").collect() 
    

提交回复
热议问题