mirror of
https://github.com/FlipsideCrypto/base-models.git
synced 2026-02-06 15:06:59 +00:00
replay missing traces
This commit is contained in:
parent
f987327a35
commit
cdc8ec6a66
@ -16,25 +16,17 @@ WITH bronze_traces AS (
|
||||
DATA :result AS full_traces,
|
||||
_inserted_timestamp
|
||||
FROM
|
||||
|
||||
{% if is_incremental() %}
|
||||
{{ ref('bronze__streamline_traces') }}
|
||||
WHERE
|
||||
_inserted_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp) _inserted_timestamp
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
{% else %}
|
||||
{{ ref('bronze__streamline_FR_traces') }}
|
||||
WHERE
|
||||
_partition_by_block_id <= 2300000
|
||||
{% endif %}
|
||||
|
||||
qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position
|
||||
ORDER BY
|
||||
_inserted_timestamp DESC)) = 1
|
||||
{{ ref('bronze__streamline_FR_traces') }}
|
||||
WHERE
|
||||
block_number IN (
|
||||
SELECT
|
||||
DISTINCT missing_block
|
||||
FROM
|
||||
silver.replay_trace_blocks
|
||||
)
|
||||
AND DATA :result IS NOT NULL qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position
|
||||
ORDER BY
|
||||
_inserted_timestamp DESC)) = 1
|
||||
),
|
||||
flatten_traces AS (
|
||||
SELECT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user