Build
Reuse Macros
Encapsulate repeated SQL logic into shared macros with explicit scope and lifecycle.
Macros keep repeated SQL behavior consistent across models and teams.
Inputs
- repeated SQL patterns
- a clear scope decision: project, catalog-global, or system
- owner and lifecycle expectations
Flow
- identify repeated transformation logic worth extracting
- create the macro with a clear name and parameter contract
- choose visibility carefully so reuse matches ownership
- update models to call the macro rather than copy the SQL
- review impact before changing widely shared macros
What Good Looks Like
- common logic has one authoritative definition
- project-specific behavior does not leak into global scope
- builders can explain macro impact before a change lands