QuestionQ55

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

A data engineer must write a Spark job that creates a new managed table with finance data. If the table already exists, the job must fail without changing any data.

Which save mode and method should the data engineer use?

Explanation

saveAsTable creates the DataFrame as a catalog table, and ErrorIfExists throws an exception when the table already exists. This prevents the existing table data from being overwritten or otherwise modified.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!