CertSafari
    Databricks Certified Data Analyst Associate· Lessons

    Domain 4 · Lesson 12/39

    Streaming Tables, Materialized Views and Dynamic Views: When to Use Each

    Create a materialized view, including knowing when to use Streaming Tables and Materialized Views, and differentiate between dynamic and materialized views.

    8 min read
    2.56% of exam
    5 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Create a streaming table with CREATE OR REFRESH STREAMING TABLE and the STREAM keyword
    • Choose a streaming table or a materialized view for a given workload
    • Explain how a dynamic view differs from a materialized view and write one with is_account_group_member()

    1.Streaming tables: process each row once

    A streaming table is a Delta table with extra support for streaming, or incremental, data processing. It is built for append-only sources and reads each input row only once. That makes it a good fit for ingestion, where data keeps arriving and must be captured without reprocessing what is already loaded. Sources include cloud object storage (through Auto Loader) and message buses such as Apache Kafka. If you create one outside a pipeline, Databricks creates and manages a serverless pipeline for it, the same way it does for a standalone materialized view.

    The statement is CREATE OR REFRESH STREAMING TABLE, not CREATE OR REPLACE. The query must be a streaming query, so you read the source through the STREAM keyword. As with a materialized view, the initial load starts right away and runs on the serverless pipeline, not on your warehouse.

    Checkpoint 1 of 5· Fill the gap

    Which keyword gives this query the streaming semantics a streaming table requires?

    CREATE OR REFRESH STREAMING TABLE sales
      SCHEDULE EVERY 1 hour
      AS SELECT product, price FROM  ?  raw_data;

    That is the cost of processing each row once. A row already appended isn't read again by later updates, so after you change the query, the table holds rows produced by different versions of it. A full refresh re-reads all earlier data from the source and rewrites every row. Streaming tables also expect streams that are bounded, either naturally or by a watermark. An unbounded stream without a watermark can make the pipeline fail from memory pressure.

    Sources12

    2.Choosing between a streaming table and a materialized view

    The choice comes down to whether you need each row handled once, quickly, or need results that are always correct. Streaming tables are the right choice for data ingestion and low-latency streaming transformations. Materialized views are the right choice for complex transformations and analytical queries. Joins show the difference most clearly. A join inside a streaming table isn't recomputed when a dimension table changes, which the docs call a fit for "fast-but-wrong" scenarios. A materialized view recomputes its joins when dimensions change, so it stays correct.

    Streaming table versus materialized view
    AspectStreaming tableMaterialized view
    Create statementCREATE OR REFRESH STREAMING TABLE ... FROM STREAM sourceCREATE OR REPLACE MATERIALIZED VIEW ... AS query
    Typical sourceAppend-only data: cloud storage via Auto Loader, KafkaExisting tables to join, aggregate or clean
    How rows are processedEach input row is handled only onceRecomputed incrementally or in full to stay correct
    When a dimension in a join changesJoin is not recomputedJoin is recomputed
    LatencyLow-latency streaming; real-time mode for sub-secondSeconds or minutes, not milliseconds
    Best fitIngestion and low-latency streaming transformationsComplex transformations, aggregations, BI dashboards

    Checkpoint 2 of 5· Check yourself

    A sales report joins transactions to a customer dimension. Customers' regions are often corrected after the fact, and the report must always show the corrected region. Which dataset type fits?

    Checkpoint 3 of 5· Exam question

    An analytics team publishes a daily net revenue summary that several BI dashboards and downstream jobs all query. The source orders table receives corrections through both inserts and updates, and the team wants Databricks to precompute the aggregation once and serve cached results to every consumer instead of recalculating it separately for each dashboard. Which dataset type best fits this requirement?

    Sources31

    3.Dynamic views versus materialized views

    The names sound alike, but the two solve different problems. A dynamic view is a standard view you create with CREATE VIEW. It uses Unity Catalog functions so that what you see depends on who you are. Its purpose is fine-grained access control: security at the column or row level, and data masking. A materialized view is a Unity Catalog managed table that physically stores query results so they are fast to read. A dynamic view stores no results. Like any standard view, it recomputes on each query.

    Unity Catalog functions used in dynamic views
    FunctionReturnsGuidance
    session_user()The current user's email addressUse when the logic depends on the individual user
    is_account_group_member()TRUE if the user belongs to an account-level groupRecommended for dynamic views on Unity Catalog data
    is_member()TRUE if the user belongs to a workspace-level groupKept for Hive metastore compatibility; avoid it for Unity Catalog data
    A dynamic view that shows email addresses only to members of the auditors groupsql
    CREATE VIEW sales_redacted AS
    SELECT
      user_id,
      CASE WHEN
        is_account_group_member('auditors') THEN email
        ELSE 'REDACTED'
      END AS email,
      country,
      product,
      total
    FROM sales_raw

    When a query runs, Spark replaces that CASE expression with either the literal 'REDACTED' or the real email column. That's why the same view returns different results to different users. Putting a CASE in the WHERE clause filters rows the same way. Databricks recommends that users not be granted read access to the tables the view references. Otherwise they could skip the view and read the raw data. To create or read dynamic views you need a SQL warehouse, compute in standard access mode, or dedicated access mode on Databricks Runtime 15.4 LTS or above.

    Checkpoint 4 of 5· Check yourself

    A dynamic view on Unity Catalog data should show salary only to an account-level group called finance. Which function should the CASE expression use?

    Checkpoint 5 of 5· Exam question

    While building a Lakeflow Spark Declarative Pipeline, an analyst wants to break a complex transformation into an intermediate logical step purely to make the pipeline easier to read and validate. This intermediate step should not persist any data or consume storage, and it only needs to be usable by other datasets inside the same pipeline. Which dataset type should the analyst define for this step?

    Sources45

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.After you change a streaming table's query, the next update rewrites every existing row with the new logic.Why is that wrong?

      Rows already appended aren't processed again. Only new rows get the new logic, and you need a full refresh to rewrite the old ones.

      Covered in Streaming tables: process each row once

    2. 2.A streaming table that joins to a dimension table updates past results when that dimension changes.Why is that wrong?

      Joins in streaming tables aren't recomputed when a dimension changes. Use a materialized view when the joined result must always be correct.

      Covered in Choosing between a streaming table and a materialized view

    3. 3.is_member() is the right function for group checks in a dynamic view on Unity Catalog data.Why is that wrong?

      is_account_group_member() is the recommended function. is_member() checks only workspace-level groups and exists for Hive metastore compatibility.

      Covered in Dynamic views versus materialized views

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “A streaming table is a Delta table with additional support for streaming or incremental data processing.”
      ↩︎ Streaming tables: process each row once
      “Streaming tables are designed for append-only data sources and process inputs only once.”
      ↩︎ Streaming tables: process each row once
      “Joins in streaming tables do not recompute when dimensions change.”
      ↩︎ Choosing between a streaming table and a materialized view
      “You can trigger a full refresh to requery all previous data from the source table to update all rows in the streaming table.”
      ↩︎ Exam trap 1
      “Joins in streaming tables do not recompute when dimensions change.”
      ↩︎ Exam trap 2
      “existing rows will not update to be uppercase, but new rows will be uppercase.”
      ↩︎ Prediction
      “Materialized views are always correct because they automatically recompute joins when dimensions change.”
      ↩︎ Checkpoint
    2. 2.
      “The query used must be a streaming query. Use the STREAM keyword to use streaming semantics to read from the source.”
      ↩︎ Streaming tables: process each row once
    3. 3.
      “Streaming tables are the right choice for data ingestion and low-latency streaming transformations.”
      ↩︎ Choosing between a streaming table and a materialized view
      “Materialized views are the right choice for complex transformations and analytical queries.”
      ↩︎ Choosing between a streaming table and a materialized view
    4. 4.
      “you can use dynamic views to configure fine-grained access control”
      ↩︎ Dynamic views versus materialized views
      “During query analysis, Apache Spark replaces the CASE statement with either the literal string REDACTED or the actual contents of the email address column.”
      ↩︎ Dynamic views versus materialized views
      “Databricks recommends that you not grant users the ability to read the tables and views referenced in the view.”
      ↩︎ Dynamic views versus materialized views
      “Recommended for use in dynamic views against Unity Catalog data.”
      ↩︎ Exam trap 3
      “Avoid using it with views against Unity Catalog data, because it does not evaluate account-level group membership.”
      ↩︎ Checkpoint
    5. 5.
      “To do this, use the ROW FILTER and MASK syntax during the creation of the materialized view.”
      ↩︎ Dynamic views versus materialized views

    Spotted a mistake, or was something unclear? Tell us.