Skip to content

Commit

Permalink
Normal trace logic (#84)
Browse files Browse the repository at this point in the history
* normal logic

* remove source
  • Loading branch information
austinFlipside authored Oct 11, 2023
1 parent e7469f6 commit 66ecd61
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 61 deletions.
46 changes: 0 additions & 46 deletions models/silver/core/silver__replay_trace_blocks.sql

This file was deleted.

35 changes: 21 additions & 14 deletions models/silver/core/silver__traces2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,27 @@ WITH bronze_traces AS (
DATA :result AS full_traces,
_inserted_timestamp
FROM
{{ ref('bronze__streamline_FR_traces') }}
WHERE
block_number IN (
SELECT
DISTINCT missing_block
FROM
{{ source(
"base_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

{% if is_incremental() %}
{{ ref('bronze__streamline_traces') }}
WHERE
_inserted_timestamp >= (
SELECT
MAX(_inserted_timestamp) _inserted_timestamp
FROM
{{ this }}
)
AND DATA :result IS NOT NULL
{% else %}
{{ ref('bronze__streamline_FR_traces') }}
WHERE
_partition_by_block_id <= 2300000
AND DATA :result IS NOT NULL
{% endif %}

qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position
ORDER BY
_inserted_timestamp DESC)) = 1
),
flatten_traces AS (
SELECT
Expand Down
1 change: 0 additions & 1 deletion models/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ sources:
schema: silver
tables:
- name: verified_abis
- name: replay_trace_blocks
- name: base_bronze_api
database: base
schema: bronze_api
Expand Down

0 comments on commit 66ecd61

Please sign in to comment.