Reputation: 8057
I have a Dataset[String] and need to convert to a RDD[String]. How?
Note: I've recently migrated from spark 1.6 to spark 2.0. Some of my clients were expecting RDD but now Spark gives me Dataset.
Upvotes: 14
Views: 22071
Reputation: 5315
As stated in the scala API documentation you can call .rdd
on your Dataset :
val myRdd : RDD[String] = ds.rdd
Upvotes: 28
Reputation: 29
Dataset is a strong typed Dataframe, so both Dataset and Dataframe could use .rdd to convert to a RDD.
Upvotes: 1