Skip to content

Commit

Permalink
switch job_id to group_by
Browse files Browse the repository at this point in the history
  • Loading branch information
robomill committed Jan 17, 2023
1 parent 2b1c5d6 commit 215f26c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion models/dim_dbt__current_models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ latest_models_runs as (
latest_model_stats as (
select
node_id
{% if target.type == 'bigquery' %}
, job_id as last_run_job_id
{% endif %}
, max(case when was_full_refresh then query_completed_at end) as last_full_refresh_run_completed_at
, max(case when was_full_refresh then total_node_runtime end) as last_full_refresh_run_total_runtime
, max(case when was_full_refresh then rows_affected end) as last_full_refresh_run_rows_affected
Expand All @@ -51,11 +54,13 @@ latest_model_stats as (
, max(rows_affected) as last_run_rows_affected
{% if target.type == 'bigquery' %}
, max(bytes_processed) as last_run_bytes_processed
, job_id as last_run_job_id,
{% endif %}
from latest_models_runs
where run_idx = 1
group by 1
{% if target.type == 'bigquery' %}
, 2
{% endif %}
),

final as (
Expand Down

0 comments on commit 215f26c

Please sign in to comment.