Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 174


The code block shown below should read a parquet at the file path filePath into a DataFrame. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__.__3__(__4__)

Show Answer
Correct Answer: A,B

To read a parquet file into a DataFrame using PySpark, the correct syntax is `spark.read.parquet(filePath)`. Here, `spark` is the SparkSession object, `read` is a property that returns a DataFrameReader, and `parquet` is the method to read parquet files. `filePath` is the path to the parquet file.

Discussion

3 comments
Sign in to comment
azure_bimonsterOption: E
Feb 10, 2024

To me E is most likely correct Syntax: spark.read.load(filePath)

Sowwy1Option: E
Apr 10, 2024

E. 1. spark 2. read 3. load 4. filePath

5effea7Option: E
Jul 12, 2024

It's E. read is a property of spark, not a method, so that makes the choice C or E. In C the parameter source is being assigned "parquet". Parquet is the format. So C is wrong. E is correct, because the default format is parquet.