added example model & source, updated get_dependencies to include all nodes

This commit is contained in:
graciegoheen
2022-01-10 14:43:54 -05:00
parent 4d3e999f11
commit f3aca96ba2
3 changed files with 6 additions and 3 deletions

View File

@@ -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
@@ -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

View File

@@ -0,0 +1,2 @@
-- a model with no upstream parent nodes
-- aka a model that is not using the source or ref function

View File

@@ -7,4 +7,5 @@ sources:
tables:
- name: table_1
- name: table_2
- name: table_3
- name: table_3
- name: table_4