Databricks Certified Associate Developer for Apache Spark — Question 178

What happens if a developer registers two DataFrames with the same view name, myView using the createOrReplaceTempView function?

Answer options

Correct answer: D

Explanation

The correct answer is D because using createOrReplaceTempView will replace any existing view with the new DataFrame's view if they share the same name. Option A is incorrect as both views cannot coexist; option B is not applicable since merging does not happen in this context. Option C is false because no exception is thrown; the existing view is simply replaced.