Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to read data from a CSV file in PySpark?
A)
readCSV()
B)
readJSON()
C)
readTextFile()
D)
read.parquet()

Correct Answer :   readCSV()


Explanation : readCSV() is used to read data from a CSV file in PySpark. It reads the contents of a CSV file and creates a DataFrame with each row of the file as a separate row in the DataFrame. Other file input/output operations in PySpark include read.json(), read.parquet(), and read.text().

Advertisement