Convert Dataframe back to RDD of case class in Spark

前端 未结 2 1197
有刺的猬
有刺的猬 2021-01-22 16:37

I am trying to convert a dataframe of multiple case classes to an rdd of these multiple cases classes. I cant find any solution. This wrappedArray has drived me cra

2条回答
  •  梦毁少年i
    2021-01-22 17:38

    I don't know the scala API but have you considered the rdd value?

    Maybe something like :

    aDR.rdd.map { case r:Row => r.getAs[randomClass3]("_2")}
    

提交回复
热议问题