Explore Courses Blog Tutorials Interview Questions
0 votes
in Big Data Hadoop & Spark by (19k points)

Initially I was unaware that Spark RDD functions cannot be applied on Spark Dataframe. So, I was getting error when I was trying to execute Spark RDD methods on Spark Dataframe.

Can anyone tell how can I convert Spark DataFrame to Spark RDD?

1 Answer

0 votes
by (33.1k points)

To simply convert Spark Dataframe to Spark RDD use .rdd method.

val rows: RDD[row] = df.rdd

I hope this answer would help you!

Browse Categories