DBT-ANALYTICS-ENGINEERING practice question 2 of 35

Select the valid methods for configuring incremental models in dbt. (Select all that apply)

Full set: 409 questions

Domain Testing & documentation

Answer options
A: Using the partition_by field to partition the data by a specific column
B: Defining a where clause to filter incremental updates Correct answer
C: Using the materialized field with the value incremental Correct answer
D: Specifying the unique_key field to determine uniqueness in the data Correct answer
Correct Answer:
B. Defining a where clause to filter incremental updates; C. Using the materialized field with the value incremental; D. Specifying the unique_key field to determine uniqueness in the data
Explanation

Configuring an incremental model in dbt involves several key steps. First, the model must be explicitly defined as incremental by setting materialized='incremental' in its configuration block (C). The core logic for an incremental run is to process only new or changed data. This is achieved by filtering the source data, typically by adding a WHERE clause to the model's SQL that leverages the isincremental() macro (B). To handle updates to existing records and prevent duplicates, a uniquekey can be specified. This key enables dbt to match records between the source and destination, performing an update/merge operation instead of a simple append (D).

Why Incorrect

A. partitionby is a data warehouse-specific configuration for performance optimization that physically organizes data. It is not a primary method for defining the incremental logic of which records to process.

References

1. dbt Labs Documentation

"Incremental models":

Reference for C: Under the "How do I use incremental models?" section

the first step listed is: "To use incremental models

you need to set the materialized configuration for a model to incremental."

Reference for B: The same section explains the second step: "You also need to tell dbt how to filter the rows for an incremental run... using the isincremental() macro." This macro is used within a WHERE clause.

Reference for D: The section "How do I use uniquekey?" states: "The optional uniquekey parameter enables updating existing rows instead of just appending new rows. If a uniquekey is specified

dbt will use a merge statement to build the model."

2. dbt Labs Documentation

"About materializations":

Reference for C: This page defines the incremental materialization: "Models can be configured as incremental... dbt will insert new records and update existing records in the table." This confirms materialized='incremental' is the foundational configuration.

3. dbt Labs Documentation

"BigQuery configs" (as an example of adapter-specific configs):

Reference for A: The partitionby configuration is listed as a specific configuration for warehouses like BigQuery to improve query performance by partitioning tables. It is described as a physical layout property

distinct from the logical filtering (WHERE clause) or update strategy (uniquekey) of the incremental model itself.

Scroll to Top