Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to write data to a file in PySpark?
A)
readTextFile()
B)
readDataFrame()
C)
writeTextFile()
D)
writeDataFrame()

Correct Answer :   writeTextFile()


Explanation : writeTextFile() is used to write data to a file in PySpark. It writes the contents of an RDD to a file with each element of the RDD on a separate line. Other file input/output operations in PySpark include write.csv(), write.json().

Advertisement