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
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:
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
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
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).