Lineage integrity · rule sql-deep-lineage
Long chains of SQL tables built on tables
A Metacenta review checks this under the rule SQL lineage stays shallow. Everything below applies whether or not you ever commission one.
What this rule checks
For SQL projects without dbt, this rule flags relations more than 8 steps downstream of anything loaded from outside. A relation built only from tables no project file writes sits at 0, and each project-built relation in between adds one. We count the longest path.
Why it matters
A change at the top of the chain has to be traced through every step before anyone knows what it breaks.
How to fix it
Shorten the deepest SQL lineage chains. Collapse intermediate steps that only rename or filter into the step they feed, starting with the deepest chain.
When it is fine to leave
A chain where every step does distinct work, and each has its own assertions, can pass 8 steps honestly. Leave it, and record why in the files. We rate the finding low severity.
What we need to check it
The .sql files, read from your repository with read-only access or uploaded. We rebuild the lineage from statements and folder layout without running the SQL. The threshold is a review setting, 8 by default.