forgot to fix incremental jinja

This commit is contained in:
Mike Stepanovic 2025-03-18 15:16:19 -06:00
parent 462c4a0d8f
commit 94382d96c6
10 changed files with 70 additions and 75 deletions

View File

@ -19,3 +19,15 @@ SELECT
complete_provider_asset_metadata_id AS dim_asset_metadata_id
FROM
{{ ref('silver__complete_provider_asset_metadata') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -21,6 +21,18 @@ SELECT
complete_token_asset_metadata_id AS ez_asset_metadata_id
FROM
{{ ref('silver__complete_token_asset_metadata') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}
UNION ALL
SELECT
NULL AS token_address,
@ -36,3 +48,14 @@ SELECT
complete_native_asset_metadata_id AS ez_asset_metadata_id
FROM
{{ ref('silver__complete_native_asset_metadata') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -23,6 +23,17 @@ SELECT
complete_token_prices_id AS ez_prices_hourly_id
FROM
{{ ref('silver__complete_token_prices') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}
UNION ALL
SELECT
HOUR,
@ -40,3 +51,14 @@ SELECT
complete_native_prices_id AS ez_prices_hourly_id
FROM
{{ ref('silver__complete_native_prices') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -20,3 +20,14 @@ SELECT
complete_provider_prices_id AS fact_prices_ohlc_hourly_id
FROM
{{ ref('silver__complete_provider_prices') }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -21,16 +21,4 @@ SELECT
FROM
{{ ref(
'bronze__complete_native_asset_metadata'
) }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}
) }}

View File

@ -25,15 +25,3 @@ FROM
{{ ref(
'bronze__complete_native_prices'
) }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -22,15 +22,3 @@ FROM
{{ ref(
'bronze__complete_provider_asset_metadata'
) }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -27,18 +27,6 @@ FROM
m
ON p.asset_id = m.asset_id
{% if is_incremental() %}
WHERE
p.modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}
qualify(ROW_NUMBER() over (PARTITION BY p.asset_id, recorded_hour, p.provider
ORDER BY
p.modified_timestamp DESC)) = 1

View File

@ -27,15 +27,3 @@ FROM
{{ ref(
'bronze__complete_token_asset_metadata'
) }} A
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}

View File

@ -7,7 +7,7 @@
SELECT
HOUR,
LOWER(
p.token_address
token_address
) AS token_address,
asset_id,
symbol,
@ -30,16 +30,3 @@ FROM
{{ ref(
'bronze__complete_token_prices'
) }}
p
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}