Skip to content

Commit

Permalink
Fixes for incremental runs
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 committed Mar 26, 2024
1 parent cb2842d commit ac8a99a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ WHERE
AND receipt_status = 1
AND receipt_contract_address IS NOT NULL
{% if is_incremental() %}
WHERE
TIMESTAMP_TRUNC(block_timestamp, DAY) >= (
SELECT TIMESTAMP_TRUNC(MAX(block_timestamp), DAY)
FROM {{ this }}
)
AND TIMESTAMP_TRUNC(block_timestamp, DAY) < CURRENT_TIMESTAMP()
{% endif %}
AND TIMESTAMP_TRUNC(block_timestamp, DAY) >= (
SELECT TIMESTAMP_TRUNC(MAX(block_timestamp), DAY)
FROM {{ this }}
)
AND TIMESTAMP_TRUNC(block_timestamp, DAY) < CURRENT_TIMESTAMP()
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ INNER JOIN logs AS l
ON t.transaction_hash = l.transaction_hash
WHERE
t.to_address IS null
{% if is_incremental() %}
AND TIMESTAMP_TRUNC(block_timestamp, DAY) >= (
{% if is_incremental() %}
AND TIMESTAMP_TRUNC(t.block_timestamp, DAY) >= (
SELECT * FROM max_block_timestamp
)
AND TIMESTAMP_TRUNC(block_timestamp, DAY) < CURRENT_TIMESTAMP()
AND TIMESTAMP_TRUNC(t.block_timestamp, DAY) < CURRENT_TIMESTAMP()
{% endif %}

0 comments on commit ac8a99a

Please sign in to comment.