Question 29
Domain 8: Data GovernanceWithin a Databricks notebook session, what is the scope of a TEMP VIEW created with Spark SQL?
Correct answer: B
Explanation
A TEMP VIEW in Spark SQL is session-scoped, so it exists only for the current SparkSession. It is not written to the metastore or storage, which is why it is “not persisted” and disappears when the session ends.
Why each option is right or wrong
A. It is available to every cluster attached to the workspace
Workspace-wide availability applies to shared tables or catalogs, not temporary views.
B. It is available only to the current SparkSession and is not persisted
Spark SQL temporary views are defined at the SparkSession level, which is the notebook’s active session context; the catalog entry is not shared across other sessions or clusters. Per Spark SQL semantics, a TEMPORARY VIEW is not stored in the metastore or any backing storage, so it vanishes when that SparkSession ends and cannot be queried after the session is closed.
C. It is published automatically to Unity Catalog
Unity Catalog governs registered data assets, not Spark TEMP VIEWs.
D. It is shared automatically with all users who can access the notebook
Notebook access does not automatically share a TEMP VIEW across users.