Courseiva
Using Spark Connect →mediumMultiple Choice

Databricks-Spark-Assoc Using Spark Connect Practice Question

Refer to the exhibit.

Traceback (most recent call last): File "app.py", line 12, in <module> df = spark.read.table("default.sales") File "/opt/spark/python/pyspark/sql/session.py", line 314, in table

return DataFrame(self._client.execute_plan(parser.parse_table(name))))

File "/opt/spark/python/pyspark/sql/connect/client/core.py", line 112, in execute_plan(y+"sessionID"), grpc.RpcError: StatusCode.UNAVAILABLE

An engineer attempts to run a PySpark script using Spark Connect but encounters the traceback shown above. What is the most likely root cause of this execution failure?

⚠ Common exam trap

Test-takers often assume the traceback points to a syntax error or a missing database table, ignoring the gRPC status code indicating a network connectivity or server availability issue.

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

✓

The Spark Connect server is unreachable, turned off, or listening on a different network port than specified in the client connection string.

The StatusCode.UNAVAILABLE gRPC error indicates that the client application cannot establish or maintain a network connection with the Spark Connect server endpoint. This typically happens when the cluster is stopped, the port is blocked by a firewall, or the connection string URL is incorrect. Verifying network accessibility and cluster status is an essential first troubleshooting step for Spark Connect deployments.

Answer analysis

Option-by-option breakdown

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

  • ✗

    The target Delta table default.sales contains corrupted parquet files that cause schema resolution errors on the remote server.

    Why it's wrong here

    Corrupted parquet files would surface as analysis or IO exceptions during query execution, not a gRPC UNAVAILABLE at plan submission, which occurs before any file is read. Parquet corruption fits cases where the Connect session is healthy but table scans fail mid-execution.

  • ✓

    The Spark Connect server is unreachable, turned off, or listening on a different network port than specified in the client connection string.

    Why this is correct

    A StatusCode.UNAVAILABLE status code is raised by the gRPC client library when it fails to connect to the remote server endpoint. This confirms a network connectivity barrier, incorrect host specification, or an inactive Spark Connect background service on the cluster.

  • ✗

    The PySpark client library version installed locally is newer than the server-side Spark runtime version, causing protocol serialization mismatches.

    Why it's wrong here

    Version skew produces serialisation or protocol errors, typically UNIMPLEMENTED or INTERNAL, not UNAVAILABLE, which signals the gRPC endpoint itself is unreachable. Client-server version mismatch fits environments where the Connect session establishes but individual RPC calls are rejected as unsupported.

  • ✗

    The user running app.py lacks Hive metastore permissions to read the default database catalog on the Databricks workspace.

    Why it's wrong here

    StatusCode.UNAVAILABLE is a gRPC transport failure indicating the Spark Connect server is unreachable, not a metastore authorisation denial, which surfaces as an analysis or permission exception. Metastore permission errors fit scenarios where the session connects successfully but catalog reads are rejected.

About these practice questions

One of 295 original Databricks-Spark-Assoc practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.