Null-safe equality (equals macro)
| Loading table... |
The enable_truthy_nulls_equals_macro flag is false by default. Setting it to true in your dbt_project.yml enables null-safe equality in the dbt equals macro, which is used in incremental and snapshot materializations.
By default, the equals() macro follows SQL's three-valued logic (3VL), so NULL = NULL evaluates to UNKNOWN rather than TRUE.
When the enable_truthy_nulls_equals_macro flag is enabled, the equals() macro uses the semantics of the IS NOT DISTINCT FROM operator with two NULL values treated as equal.
To enable the flag, add it under flags in dbt_project.yml:
dbt_project.yml
flags:
enable_truthy_nulls_equals_macro: true
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
0