DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice question 21 of 25

The code block displayed below contains an error. The code block should save DataFrame transactionsDf at path path as a parquet file, appending to any existing parquet file. Find the error. Code block:

Full set: 180 questions
Answer options
A: transactionsDf.format("parquet").option("mode", "append").save(path)
B: The code block is missing a reference to the DataFrameWriter. Correct answer
C: save() is evaluated lazily and needs to be followed by an action.
D: The mode option should be omitted so that the command uses the default mode.
E: The code block is missing a bucketBy command that takes care of partitions.
F: Given that the DataFrame should be saved as parquet file, path is being passed to the wrong method.
Correct Answer:
B. The code block is missing a reference to the DataFrameWriter.
Explanation

Correct code block: transactionsDf.write.format("parquet").option("mode", "append").save(path)

Scroll to Top