Skip to content

Commit

Permalink
Merge pull request #42 from FlipsideCrypto/an-4888
Browse files Browse the repository at this point in the history
AN-4888 one more commit for clock skew
  • Loading branch information
eric-laurello authored Jul 26, 2024
2 parents b62848d + f95a65f commit 9063af0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion models/silver/silver__block_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
materialized = 'incremental',
unique_key = 'day',
incremental_strategy = 'merge',
cluster_by = ['block_timestamp::DATE']
cluster_by = ['day']
) }}

WITH all_block_id AS (
Expand Down
4 changes: 2 additions & 2 deletions models/silver/silver__daily_earnings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WHERE
block_timestamp :: DATE >= (
SELECT
MAX(
DAY
DAY - INTERVAL '2 DAYS' --counteract clock skew
)
FROM
{{ this }}
Expand All @@ -48,7 +48,7 @@ WHERE
block_timestamp :: DATE >= (
SELECT
MAX(
DAY
DAY - INTERVAL '2 DAYS' --counteract clock skew
)
FROM
{{ this }}
Expand Down
2 changes: 1 addition & 1 deletion models/silver/silver__daily_pool_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
materialized = 'incremental',
unique_key = "_unique_key",
incremental_strategy = 'merge',
cluster_by = ['block_timestamp::DATE'],
cluster_by = ['day'],
incremental_predicates = ['DBT_INTERNAL_DEST.day >= (select min(day) from ' ~ generate_tmp_view_name(this) ~ ')']
) }}

Expand Down
4 changes: 2 additions & 2 deletions models/silver/silver__prices.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WITH blocks AS (

{% if is_incremental() %}
WHERE
b.block_timestamp :: DATE >= (
b.block_timestamp >= (
SELECT
MAX(
block_timestamp - INTERVAL '1 HOUR'
Expand All @@ -46,7 +46,7 @@ price AS (

{% if is_incremental() %}
WHERE
b.block_timestamp :: DATE >= (
b.block_timestamp >= (
SELECT
MAX(
block_timestamp - INTERVAL '1 HOUR'
Expand Down
2 changes: 1 addition & 1 deletion models/silver/silver__total_block_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ FROM
{% if is_incremental() %}
WHERE
(
b.block_timestamp :: DATE >= (
b.block_timestamp >= (
SELECT
MAX(
block_timestamp - INTERVAL '1 HOUR'
Expand Down

0 comments on commit 9063af0

Please sign in to comment.