DataFrame.
toJSON
Converts a DataFrame into a RDD of string.
DataFrame
RDD
Each row is turned into a JSON document as one element in the returned RDD.
Examples
>>> df.toJSON().first() '{"age":2,"name":"Alice"}'
previous
pyspark.sql.DataFrame.toDF
next
pyspark.sql.DataFrame.toLocalIterator