Skip to content

Commit

Permalink
Add job_sk (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGFagan authored Sep 8, 2022
1 parent 92dda73 commit de18a32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions models/fct_dbt__invocations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ invocations as (
select
base.command_invocation_id,
base.job_id,
base.job_sk,
base.dbt_version,
base.project_name,
base.run_started_at,
Expand Down
7 changes: 6 additions & 1 deletion models/staging/stg_dbt__invocations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ enhanced as (

select
command_invocation_id,
{{ dbt_utils.surrogate_key(['coalesce(dbt_cloud_job_id, job_name)']) }} as job_id,
coalesce(
dbt_cloud_job_id,
job_name,
target_database || '.' || target_schema
) as job_id,
{{ dbt_utils.surrogate_key(['job_id']) }} as job_sk,
dbt_version,
project_name,
run_started_at,
Expand Down

0 comments on commit de18a32

Please sign in to comment.