convert ez table is a view

This commit is contained in:
mattromano 2024-06-25 13:17:48 -07:00
parent f1b24634e6
commit a98be9edc3
5 changed files with 6 additions and 86 deletions

View File

@ -1,12 +1,8 @@
{{ config (
materialized = "incremental",
unique_key = ['block_number', 'event_index'],
cluster_by = "block_timestamp::date",
incremental_predicates = ["dynamic_range", "block_number"],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
merge_exclude_columns = ["inserted_timestamp"],
tags = ['decoded_logs','reorg']
) }}
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true }
) }}
SELECT
block_number,
@ -31,13 +27,4 @@ SELECT
FROM
{{ ref('silver__decoded_logs') }}
l
LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address)
{% if is_incremental() %}
WHERE
modified_timestamp > (
SELECT
MAX(modified_timestamp)
FROM
{{ this }}
)
{% endif %}
LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address)

View File

@ -1,9 +0,0 @@
{{ config (
materialized = 'view',
tags = ['full_test']
) }}
SELECT
*
FROM
{{ ref('core__ez_decoded_event_logs') }}

View File

@ -1,17 +0,0 @@
version: 2
models:
- name: test_gold__ez_decoded_event_logs_full
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EZ_DECODED_EVENT_LOGS_ID
- dbt_utils.recency:
datepart: day
field: INSERTED_TIMESTAMP
interval: 1
columns:
- name: BLOCK_TIMESTAMP
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1

View File

@ -1,23 +0,0 @@
{{ config (
materialized = 'view',
tags = ['recent_test']
) }}
WITH last_3_days AS (
SELECT
block_number
FROM
{{ ref("_block_lookback") }}
)
SELECT
*
FROM
{{ ref('core__ez_decoded_event_logs') }}
WHERE
block_number >= (
SELECT
block_number
FROM
last_3_days
)

View File

@ -1,18 +0,0 @@
version: 2
models:
- name: test_gold__ez_decoded_event_logs_recent
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EZ_DECODED_EVENT_LOGS_ID
- dbt_utils.recency:
datepart: day
field: INSERTED_TIMESTAMP
interval: 1
- missing_gold_decoded_logs
columns:
- name: BLOCK_TIMESTAMP
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: hour
interval: 3