Skip to content

Commit 941b2f4

Browse files
committed
one off date issue
1 parent da8e2ca commit 941b2f4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pkg/rewards/11_goldActiveODOperatorSetRewards.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WITH
1717
active_rewards_modified AS (
1818
SELECT
1919
*,
20-
CAST(@cutoffDate AS TIMESTAMP(6)) AS global_end_inclusive -- Inclusive means we DO USE this day as a snapshot
20+
CAST(@cutoffDate AS TIMESTAMP(6)) + INTERVAL '1 day' - INTERVAL '1 second' AS global_end_inclusive -- Use end of cutoff day to include all rewards ending on cutoff date
2121
FROM operator_directed_operator_set_rewards
2222
WHERE end_timestamp >= TIMESTAMP '{{.rewardsStart}}'
2323
AND start_timestamp <= TIMESTAMP '{{.cutoffDate}}'

pkg/rewards/1_goldActiveRewards.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create table {{.destTableName}} as
1515
WITH active_rewards_modified as (
1616
SELECT *,
1717
amount/(duration/86400) as tokens_per_day,
18-
cast(@cutoffDate AS TIMESTAMP(6)) as global_end_inclusive -- Inclusive means we DO USE this day as a snapshot
18+
cast(@cutoffDate AS TIMESTAMP(6)) + INTERVAL '1 day' - INTERVAL '1 second' as global_end_inclusive -- Use end of cutoff day to include all rewards ending on cutoff date
1919
FROM combined_rewards
2020
WHERE
2121
end_timestamp >= TIMESTAMP '{{.rewardsStart}}'

pkg/rewards/7_goldActiveODRewards.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WITH
1717
active_rewards_modified AS (
1818
SELECT
1919
*,
20-
CAST(@cutoffDate AS TIMESTAMP(6)) AS global_end_inclusive -- Inclusive means we DO USE this day as a snapshot
20+
CAST(@cutoffDate AS TIMESTAMP(6)) + INTERVAL '1 day' - INTERVAL '1 second' AS global_end_inclusive -- Use end of cutoff day to include all rewards ending on cutoff date
2121
FROM operator_directed_rewards
2222
WHERE end_timestamp >= TIMESTAMP '{{.rewardsStart}}'
2323
AND start_timestamp <= TIMESTAMP '{{.cutoffDate}}'

0 commit comments

Comments
 (0)