Accepted answer
Add a relationships test to dim_product, plus a custom test for null rate thresholds per partition, not just row-level not_null.
Nightly dbt run: unique and not_null on order_id both pass. Still seeing null product_category in Looker for yesterday's partition.
Model is incremental merge on order_id. I suspect late-arriving dimension rows. What tests or patterns catch this in dbt?
Accepted answer
Add a relationships test to dim_product, plus a custom test for null rate thresholds per partition, not just row-level not_null.
Use dbt expectations or elementary for anomaly detection on null percentage by day. A static not_null test misses partition-level drift.
Then test accepted_relationships with a severity warn above X%, or store an unknown_product bucket explicitly so the nulls are actually visible in BI instead of hidden.
ELI5: think of it like a phone book. If it's sorted by last name and you search by last name, that's fast. Search by first name instead and you're flipping through every page.
Our dimension is slowly changing, does that change the join order?
Check whether AQE is disabled in your Spark conf, skew join handling helped us a lot here.
Snapshot dim_product and join as-of the order timestamp instead of the latest dimension row.
Sign in to reply.
© 2026 Lakebench, operated by Hunnurji Rao. Bengaluru, Karnataka, India.
No cluster. No install. Just the tab.