Courseiva
Using Spark Connect →hardMultiple Choice

Databricks-Spark-Assoc Using Spark Connect Practice Question

A developer uses a Spark Connect session to create a temporary view with `df.createOrReplaceTempView("sales_v")` and then runs `spark.sql("SELECT * FROM sales_v")` in the same session. What is the scope of that temporary view?

⚠ Common exam trap

The trap here is assuming that a temporary view created through a Spark Connect client lives on the client, when it is actually registered in the server-side session catalog and scoped to that session.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

It is registered in the server-side session catalog and is visible to operations within that session.

Creating a temporary view in Spark Connect sends a command to the server, which registers the view in the session catalog. Subsequent SQL in the same session resolves it because both operations share the same server-side session state. The view is not client-local, not cluster-global, and not persisted to the metastore; it vanishes when the session ends.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    It is registered in the server-side session catalog and is visible to operations within that session.

    Why this is correct

    When the client calls `createOrReplaceTempView`, the command is serialized and sent to the server, which registers the view in the session's catalog. Subsequent `spark.sql` calls in the same session can resolve the view because they execute against the same server-side session state. The view is not persisted beyond the session unless it is a global temporary view or a permanent object.

  • ✗

    It is stored on the client machine and is visible only to the creating Python process.

    Why it's wrong here

    Temporary views are catalog objects on the server, not client-side structures. The client only sends the command to register the view, and the server records it in the session catalog. Visibility is therefore tied to the server session, not to the client process, so this description is incorrect for Spark Connect.

  • ✗

    It is written to the workspace metastore as a persistent view that survives cluster restarts.

    Why it's wrong here

    Temporary views are not persisted to the metastore. They live only in the session catalog and disappear when the session ends or the cluster restarts. Persisting a view requires creating a permanent view with `CREATE VIEW` in a database, which is a different command and scope. This option incorrectly describes the temporary view as durable.

  • ✗

    It is registered globally on the cluster and is visible to all users and sessions.

    Why it's wrong here

    A standard temporary view is session-scoped, not cluster-wide. Only global temporary views, created with `createOrReplaceGlobalTempView`, are visible across sessions in the same application, and even those are not shared across users' separate applications. This option overstates the scope and would confuse session-local objects with global ones.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every Databricks-Spark-Assoc question from scratch — 295 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Databricks exam blueprint

This Databricks-Spark-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-Spark-Assoc exam.