Skip to content

Commit

Permalink
added example model & source, updated get_dependencies to include all…
Browse files Browse the repository at this point in the history
… nodes
  • Loading branch information
graciegoheen committed Jan 10, 2022
1 parent 4d3e999 commit f3aca96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions macros/get_dependencies.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
),

-- recursive CTE
-- one record for every root node and each of its downstream children (including itself)
-- one record for every node and each of its downstream children (including itself)
all_relationships as (

-- anchor
Expand All @@ -67,7 +67,7 @@
0 as distance,
array_construct(child) as path {# snowflake-specific, but helpful for troubleshooting right now #}
from direct_relationships
where direct_parent is null
-- where direct_parent is null {# optional lever to change filtering of anchor clause to only include root nodes #}

union all

Expand Down
2 changes: 2 additions & 0 deletions models/marts/fct_model_8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- a model with no upstream parent nodes
-- aka a model that is not using the source or ref function
3 changes: 2 additions & 1 deletion models/staging/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sources:
tables:
- name: table_1
- name: table_2
- name: table_3
- name: table_3
- name: table_4

0 comments on commit f3aca96

Please sign in to comment.