rm temp filters

This commit is contained in:
Eric Laurello 2025-10-10 16:39:33 -04:00
parent 89fcf827e6
commit fdffc38cdf
6 changed files with 98 additions and 97 deletions

View File

@ -7,8 +7,10 @@ SELECT
epoch,
DATA
FROM
{{ source('bronze_streamline', 'checkpoints_backfill') }}
{{ source(
'bronze_streamline',
'checkpoints_backfill'
) }}
WHERE
epoch <= 629
AND checkpoint_number < 96605300
AND epoch = 628
AND checkpoint_number < 96605300 {# AND epoch = 628 #}

View File

@ -7,8 +7,10 @@ SELECT
epoch,
DATA
FROM
{{ source('bronze_streamline', 'events_backfill') }}
{{ source(
'bronze_streamline',
'events_backfill'
) }}
WHERE
epoch <= 629
AND VALUE: checkpoint :: INT < 96605300
AND epoch = 628
AND VALUE: checkpoint :: INT < 96605300 {# AND epoch = 628 #}

View File

@ -34,23 +34,22 @@ WHERE
{{ this }})
{% endif %}
{# {% if is_incremental() %}
{% else %}
#}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
epoch,
checkpoint_digest,
previous_digest,
network_total_transactions,
validator_signature,
tx_count,
ARRAY_CONSTRUCT() AS transactions_array,
{{ dbt_utils.generate_surrogate_key(['checkpoint_number']) }} AS fact_checkpoints_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp
FROM
{{ ref('silver__checkpoints_backfill') }}
{# {% endif %} #}
{% if is_incremental() %}
{% else %}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
epoch,
checkpoint_digest,
previous_digest,
network_total_transactions,
validator_signature,
tx_count,
ARRAY_CONSTRUCT() AS transactions_array,
{{ dbt_utils.generate_surrogate_key(['checkpoint_number']) }} AS fact_checkpoints_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp
FROM
{{ ref('silver__checkpoints_backfill') }}
{% endif %}

View File

@ -42,33 +42,33 @@ WHERE
{{ this }})
{% endif %}
{# {% if is_incremental() %}
{% else %}
#}
UNION ALL
SELECT
{% if is_incremental() %}
{% else %}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
NULL AS event_value,
event_index,
TYPE,
package_id,
transaction_module,
sender,
parsed_json
FROM
{{ ref('silver__events_backfill') }} A
JOIN {{ ref('silver__transactions_backfill') }}
b USING (
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
NULL AS event_value,
event_index,
TYPE,
package_id,
transaction_module,
sender,
parsed_json
FROM
{{ ref('silver__events_backfill') }} A
JOIN {{ ref('silver__transactions_backfill') }}
b USING (
checkpoint_number,
tx_digest
) {# {% endif %} #}
)
tx_digest
)
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,

View File

@ -50,32 +50,31 @@ WHERE
{{ this }})
{% endif %}
{# {% if is_incremental() %}
{% else %}
#}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
tx_error,
tx_dependencies,
gas_used_computation_fee,
gas_used_non_refundable_storage_fee,
gas_used_storage_fee,
gas_used_storage_rebate,
gas_budget,
gas_owner,
gas_price,
tx_fee
FROM
{{ ref('silver__transaction_blocks_backfill') }}
{# {% endif %} #}
)
{% if is_incremental() %}
{% else %}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
tx_error,
tx_dependencies,
gas_used_computation_fee,
gas_used_non_refundable_storage_fee,
gas_used_storage_fee,
gas_used_storage_rebate,
gas_budget,
gas_owner,
gas_price,
tx_fee
FROM
{{ ref('silver__transaction_blocks_backfill') }}
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,

View File

@ -41,25 +41,24 @@ WHERE
{{ this }})
{% endif %}
{# {% if is_incremental() %}
{% else %}
#}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
payload_index,
payload_type,
payload_details
FROM
{{ ref('silver__transactions_backfill') }}
{# {% endif %} #}
)
{% if is_incremental() %}
{% else %}
UNION ALL
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_kind,
tx_sender,
message_version,
tx_succeeded,
payload_index,
payload_type,
payload_details
FROM
{{ ref('silver__transactions_backfill') }}
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,