Skip to content

Commit

Permalink
feat: adjust stg model to incorprate run_result genrated by dbt build
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxuanrong committed Sep 16, 2022
1 parent f124f53 commit 042d56f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion models/staging/stg_dbt__model_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dbt_run as (

select *
from run_results
where data:args:which = 'run'
where data:args:which in ('run', 'build')

),

Expand Down Expand Up @@ -46,6 +46,7 @@ fields as (
result.value:adapter_response:rows_affected::int as rows_affected
from dbt_run,
lateral flatten(input => data:results) as result
where startswith(node_id, 'model')

),

Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_dbt__run_results.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dbt_run as (

select *
from run_results
where data:args:which in ('run', 'seed', 'snapshot', 'test')
where data:args:which in ('run', 'seed', 'snapshot', 'test', 'build')

),

Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_dbt__run_results_env_keys.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dbt_run as (

select *
from run_results
where data:args:which = 'run'
where data:args:which in ('run',' build')

),

Expand Down
3 changes: 2 additions & 1 deletion models/staging/stg_dbt__test_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dbt_run as (

select *
from run_results
where data:args:which = 'test'
where data:args:which in ('test', 'build')

),

Expand Down Expand Up @@ -47,6 +47,7 @@ fields as (
result.value:adapter_response:rows_affected::int as rows_affected
from dbt_run,
lateral flatten(input => data:results) as result
where startswith(node_id, 'test')

),

Expand Down

0 comments on commit 042d56f

Please sign in to comment.