Skip to content

Commit

Permalink
Hotfix: use latest received_at (#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifoukarakis authored Nov 12, 2024
1 parent 74007a6 commit 9d92352
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ select
, user_id
, true as is_active
-- Required for incremental loading
, received_at_date
-- Use max to ensure that the most recent received_at_date is used
, max(received_at_date) as received_at_date
, {{ dbt_utils.pivot('client_type', ['IS_DESKTOP', 'IS_WEBAPP']) }}
from tmp
where
activity_date >= '{{ var('telemetry_start_date')}}'
group by
activity_date, server_id, user_id, received_at_date
activity_date, server_id, user_id
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ select
, user_id
, true as is_active
-- Required for incremental loading
, received_at_date
-- Use max to ensure that the most recent received_at_date is used
, max(received_at_date) as received_at_date
from
tmp
where
activity_date >= '{{ var('telemetry_start_date')}}'
activity_date >= '{{ var('telemetry_start_date')}}'
group by activity_date, server_id, user_id
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ select
, user_id
, true as is_active
-- Required for incremental loading
, received_at_date
-- Use max to ensure that the most recent received_at_date is used
, max(received_at_date) as received_at_date
, {{ dbt_utils.pivot('client_type', ['IS_DESKTOP', 'IS_WEBAPP']) }}
from tmp
where
activity_date >= '{{ var('telemetry_start_date')}}'
group by
activity_date, server_id, user_id, received_at_date
activity_date, server_id, user_id
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ select
, user_id
, true as is_active
-- Required for incremental loading
, received_at_date
-- Use max to ensure that the most recent received_at_date is used
, max(received_at_date) as received_at_date
from
tmp
where
activity_date >= '{{ var('telemetry_start_date')}}'
group by activity_date, server_id, user_id

0 comments on commit 9d92352

Please sign in to comment.