Courseiva
Structured Streaming →easyMultiple Choice

Databricks-Spark-Assoc Structured Streaming Practice Question

You are monitoring a Structured Streaming query in Databricks and want to see the current status, including the number of input rows per second and the batch duration. Which of the following is the most direct way to access this information?

⚠ Common exam trap

The trap here is assuming that there is a SQL command to show streaming queries or that Delta logs contain runtime metrics, when in fact these are accessed via the streaming query API.

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

✓

Use the `StreamingQuery.lastProgress` method on the query object.

The `StreamingQuery.lastProgress` method provides a structured snapshot of the most recent micro-batch's metrics, including input rate and batch duration. It is the direct API for monitoring. Log files are not structured, there is no SQL command for showing streaming queries, and Delta logs do not contain streaming metrics. Thus, `lastProgress` is the correct choice.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Query the `spark.streaming` log file on the driver node.

    Why it's wrong here

    While logs may contain some information, they are not the most direct or structured way to access real-time metrics. Log files are verbose and not easily queryable for specific metrics like input rows per second. The streaming query progress is better accessed through the `StreamingQuery` API or the Spark UI, which provide structured, up-to-date metrics. Log files are not the recommended method for monitoring.

  • ✗

    Run `spark.sql("SHOW STREAMING QUERIES")`.

    Why it's wrong here

    There is no SQL command `SHOW STREAMING QUERIES` in Apache Spark. While you can use `spark.streams.active` to get active queries, there is no SQL syntax for this. The correct way to list queries is via the Scala/Python API. Therefore, this command would result in an error and is not a valid method.

  • ✗

    Check the Delta table's transaction log for streaming metrics.

    Why it's wrong here

    The Delta table's transaction log records data changes and metadata, but it does not contain streaming query metrics like input rows per second or batch duration. Those metrics are part of the streaming query's runtime state, not the storage layer. Inspecting the Delta log would not provide the desired monitoring information.

  • ✓

    Use the `StreamingQuery.lastProgress` method on the query object.

    Why this is correct

    `StreamingQuery.lastProgress` returns a JSON object containing detailed metrics for the most recent micro-batch, including input rows per second, processing rate, batch duration, and more. It is a direct API call on the streaming query object and provides the most immediate and structured access to the query's status. This method is commonly used to programmatically monitor streaming queries.

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.