-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more resource types into package (#1)
* Add seed, snapshot, test dimensions and executions * Change run_results to include seed, snapshot, test * Update README with models * Update attribute names to be resource-specific * Update resource columns in execution models * Pass depends_on_nodes to fct model
- Loading branch information
Showing
16 changed files
with
579 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{ config( materialized='incremental', unique_key='manifest_seed_id' ) }} | ||
|
||
with dbt_seeds as ( | ||
|
||
select * from {{ ref('stg_dbt__seeds') }} | ||
|
||
), | ||
|
||
dbt_seeds_incremental as ( | ||
|
||
select * | ||
from dbt_seeds | ||
|
||
{% if is_incremental() %} | ||
-- this filter will only be applied on an incremental run | ||
where artifact_generated_at > (select max(artifact_generated_at) from {{ this }}) | ||
{% endif %} | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
manifest_seed_id, | ||
command_invocation_id, | ||
dbt_cloud_run_id, | ||
artifact_generated_at, | ||
node_id, | ||
seed_database, | ||
seed_schema, | ||
name, | ||
depends_on_nodes, | ||
package_name, | ||
seed_path, | ||
checksum | ||
from dbt_seeds_incremental | ||
|
||
) | ||
|
||
select * from fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{ config( materialized='incremental', unique_key='manifest_snapshot_id' ) }} | ||
|
||
with dbt_snapshots as ( | ||
|
||
select * from {{ ref('stg_dbt__snapshots') }} | ||
|
||
), | ||
|
||
dbt_snapshots_incremental as ( | ||
|
||
select * | ||
from dbt_snapshots | ||
|
||
{% if is_incremental() %} | ||
-- this filter will only be applied on an incremental run | ||
where artifact_generated_at > (select max(artifact_generated_at) from {{ this }}) | ||
{% endif %} | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
manifest_snapshot_id, | ||
command_invocation_id, | ||
dbt_cloud_run_id, | ||
artifact_generated_at, | ||
node_id, | ||
snapshot_database, | ||
snapshot_schema, | ||
name, | ||
depends_on_nodes, | ||
package_name, | ||
snapshot_path, | ||
checksum | ||
from dbt_snapshots_incremental | ||
|
||
) | ||
|
||
select * from fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ config( materialized='incremental', unique_key='manifest_test_id' ) }} | ||
|
||
with dbt_tests as ( | ||
|
||
select * from {{ ref('stg_dbt__tests') }} | ||
|
||
), | ||
|
||
dbt_tests_incremental as ( | ||
|
||
select * | ||
from dbt_tests | ||
|
||
{% if is_incremental() %} | ||
-- this filter will only be applied on an incremental run | ||
where artifact_generated_at > (select max(artifact_generated_at) from {{ this }}) | ||
{% endif %} | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
manifest_test_id, | ||
command_invocation_id, | ||
dbt_cloud_run_id, | ||
artifact_generated_at, | ||
node_id, | ||
name, | ||
depends_on_nodes, | ||
package_name, | ||
test_path | ||
from dbt_tests_incremental | ||
|
||
) | ||
|
||
select * from fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ config( materialized='incremental', unique_key='seed_execution_id' ) }} | ||
|
||
with seeds as ( | ||
|
||
select * | ||
from {{ ref('dim_dbt__seeds') }} | ||
|
||
), | ||
|
||
seed_executions as ( | ||
|
||
select * | ||
from {{ ref('stg_dbt__seed_executions') }} | ||
|
||
), | ||
|
||
seed_executions_incremental as ( | ||
|
||
select * | ||
from seed_executions | ||
|
||
{% if is_incremental() %} | ||
-- this filter will only be applied on an incremental run | ||
where artifact_generated_at > (select max(artifact_generated_at) from {{ this }}) | ||
{% endif %} | ||
|
||
), | ||
|
||
seed_executions_with_materialization as ( | ||
|
||
select | ||
seed_executions_incremental.*, | ||
seeds.seed_schema, | ||
seeds.name | ||
from seed_executions_incremental | ||
left join seeds on | ||
( | ||
seed_executions_incremental.command_invocation_id = seeds.command_invocation_id | ||
or seed_executions_incremental.dbt_cloud_run_id = seeds.dbt_cloud_run_id | ||
) | ||
and seed_executions_incremental.node_id = seeds.node_id | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
seed_execution_id, | ||
command_invocation_id, | ||
dbt_cloud_run_id, | ||
artifact_generated_at, | ||
was_full_refresh, | ||
node_id, | ||
thread_id, | ||
status, | ||
compile_started_at, | ||
query_completed_at, | ||
total_node_runtime, | ||
rows_affected, | ||
seed_schema, | ||
name | ||
from seed_executions_with_materialization | ||
|
||
) | ||
|
||
select * from fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ config( materialized='incremental', unique_key='snapshot_execution_id' ) }} | ||
|
||
with snapshots as ( | ||
|
||
select * | ||
from {{ ref('dim_dbt__snapshots') }} | ||
|
||
), | ||
|
||
snapshot_executions as ( | ||
|
||
select * | ||
from {{ ref('stg_dbt__snapshot_executions') }} | ||
|
||
), | ||
|
||
snapshot_executions_incremental as ( | ||
|
||
select * | ||
from snapshot_executions | ||
|
||
{% if is_incremental() %} | ||
-- this filter will only be applied on an incremental run | ||
where artifact_generated_at > (select max(artifact_generated_at) from {{ this }}) | ||
{% endif %} | ||
|
||
), | ||
|
||
snapshot_executions_with_materialization as ( | ||
|
||
select | ||
snapshot_executions_incremental.*, | ||
snapshots.snapshot_schema, | ||
snapshots.name | ||
from snapshot_executions_incremental | ||
left join snapshots on | ||
( | ||
snapshot_executions_incremental.command_invocation_id = snapshots.command_invocation_id | ||
or snapshot_executions_incremental.dbt_cloud_run_id = snapshots.dbt_cloud_run_id | ||
) | ||
and snapshot_executions_incremental.node_id = snapshots.node_id | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
snapshot_execution_id, | ||
command_invocation_id, | ||
dbt_cloud_run_id, | ||
artifact_generated_at, | ||
was_full_refresh, | ||
node_id, | ||
thread_id, | ||
status, | ||
compile_started_at, | ||
query_completed_at, | ||
total_node_runtime, | ||
rows_affected, | ||
snapshot_schema, | ||
name | ||
from snapshot_executions_with_materialization | ||
|
||
) | ||
|
||
select * from fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.