Exam Associate-Developer-Apache-Spark-3.5 Topic 1 Question 126 Discussion

Actual exam question for Databricks's Associate-Developer-Apache-Spark-3.5 exam
Question #: 126
Topic #: 1
A data engineer needs to persist a file-based data source to a specific location. However, by default, Spark writes to the warehouse directory (e.g., /user/hive/warehouse). To override this, the engineer must explicitly define the file path.
Which line of code ensures the data is saved to a specific location?
Options:

Suggested Answer: C Vote an answer

To persist a table and specify the save path, use:
users.write.option("path","/some/path").saveAsTable("default_table")
The .option("path", ...) must be applied before calling saveAsTable.
Option A uses invalid syntax (write(path=...)).
Option B applies.option()after.saveAsTable()-which is too late.
Option D uses incorrect syntax (no path parameter in saveAsTable).
Reference:Spark SQL - Save as Table

by Dylan at Jun 22, 2026, 12:21 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10