We don't need to keep staging and intermediate dbt models around for very long, and they can easily cause strain to our HDFS infrastructure if we don't manage them.
For example, in T437733: User and team Hive database cleanup tracking for Fall 2026, we found that one of the largest consumers of storage, and also with a large number of files, was an intermediate dbt model.
Acceptance criteria
- Materialized staging and intermediate dbt models are deleted after 3 days.
Implementation notes
We considered, but haven't yet decided on, moving staging and intermediate models to a different database schema to simplify this. If we go this way, I'd like to make sure that dbt can abstract this away from model owners (e.g. having ref() resolve to the right schema). The fact that dbt has support for custom schemas seems promising.