Skip to content

Time-series agregation code duplication prevention⚓

  • Status: proposed
  • Deciders: Equip de Dades
  • Date: 2022-10-06

Technical Story:

Context and Problem Statement⚓

Un dels motius de dbt és reduir code duplication per les agregacions (diaria, setmanal, mensual, trimestral, anual...), com ho podem fer a dbt?

As-is necessitem un model per cada agregació per cada taula final, que no ens evita la duplicació de codi tot perquè cada agregació necessita el seu model

Decision Drivers ⚓

  • [driver 1, e.g., a force, facing concern, …]
  • [driver 2, e.g., a force, facing concern, …]
  • …

Considered Options⚓

  1. soft-linked macro on every data mart
  2. just repeat models with macros for aggregations
  3. use post-hooks to move tables 1
  4. other stuff
  5. dbt metrics support!

Decision Outcome⚓

  1. dbt metrics support (en discussió)

Positive Consequences ⚓

  • [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]
  • …

Negative Consequences ⚓

  • [e.g., compromising quality attribute, follow-up decisions required, …]
  • …

Pros and Cons of the Options ⚓

[option 1]⚓

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]
  • …

[option 2]⚓

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]
  • …

[option 3]⚓

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]
  • …
  • [Link type] [Link to ADR]
  • …