Library /
Rule
Debounce fan-in
A scheduling rule that waits until every table a mart reads has a new write, then rebuilds the mart once.
Use it when A mart reads several tables and should rebuild once, after all of them have loaded.
- name: Refresh the daily sales mart after the warehouse loads
code_id: marts/mart-sales-daily
description: Rebuilds mart_sales_daily once its source tables have settled.
priority: 5
status: active
applies_to:
node_type: DataformAction
node_ids:
- DataformAction_acme-mart-{ENV}.marts.mart_sales_daily
when:
events:
- origin: ancestors
ancestor_depth: direct_materialized
types:
- BIGQUERY_INSERT
- BIGQUERY_MERGE
wait_for_all_ancestors: true
wait_for_all_ancestors_timeout_seconds: 5400
wait_for_all_ancestors_timeout_alert: true
if:
quiet_period_seconds: 600
then:
target:
same_as_applies_to: true
scope: node
do:
kind: single
action:
type: dataform_run
parameters:
release: projects/acme-mart-{ENV}/locations/europe-west1/repositories/acme-marts/releaseConfigs/daily
Taken from docs/concepts/scheduling.md
wait_for_all_ancestors holds the rule until every direct ancestor has produced a new event since the last run. If the
mart reads three tables, it waits for all three. quiet_period_seconds then waits for 10 quiet minutes, so a load that
writes many times fires once.
After 5400 seconds the rule fires anyway with whatever is ready, and wait_for_all_ancestors_timeout_alert opens an
incident naming the ancestors that were still missing. Event types are matched exactly, so list every write type you
care about.
Feeds fromGoogle Cloud