flow-models/models/silver/prices/silver__complete_native_prices.sql
2024-07-15 09:28:47 -06:00

42 lines
749 B
SQL

{{ config(
materialized = 'incremental',
incremental_strategy = 'delete+insert',
unique_key = 'complete_native_prices_id',
cluster_by = ['HOUR::DATE'],
tags = ['scheduled_non_core']
) }}
SELECT
HOUR,
asset_id,
symbol,
NAME,
decimals,
price,
blockchain,
is_imputed,
is_deprecated,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_native_prices_id,
_invocation_id
FROM
{{ ref(
'bronze__complete_native_prices'
) }}
{% if is_incremental() %}
WHERE
modified_timestamp >= (
SELECT
MAX(
modified_timestamp
)
FROM
{{ this }}
)
{% endif %}