
Answer-first summary for fast verification
Answer: 4, 3, 6
To read a Parquet file into a DataFrame, the correct sequence starts with the SparkSession (`spark`), followed by `.read`, and then specifying the Parquet file using `.parquet(filePath)`. Option C (4, 3, 6) correctly chains these steps as `spark.read.parquet(filePath)`. Other options are invalid due to incorrect method calls (e.g., `.read()` instead of `.read`) or incorrect parameters (e.g., `source="parquet"` instead of `format="parquet"`).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In what order should the below lines of code be run in order to read a parquet at the file path filePath into a DataFrame?
Lines of code:
(1) storesDF
(2) .load(filePath, source = "parquet")
(3) .read
(4) spark
(5) .read()
(6) .parquet(filePath)
A
1, 5, 2
B
4, 5, 2
C
4, 3, 6
D
4, 5, 6
E
4, 3, 2