JaimeCr JaimeCr - 1 year ago 180
R Question

How to convert SparkR DataFrame to RDD

I know how to convert a text file into an RDD with SparkR:

data <- textFile(sc, "data/tsv_wiki")

But I would want to know how to convert an object of type DataFrame in R to an RDD.

Any help would be appreciated.

Answer Source

It couldn't be easier.

converted.rdd <- SparkR:::toRDD(dataframe)

Note the triple colon operator, meaning that it's an internal function.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download