mirror of
https://github.com/FlipsideCrypto/stellar-models.git
synced 2026-02-06 15:06:59 +00:00
* standard prices with some customizations * . * check * tests/desc * added overview file --------- Co-authored-by: Mike Stepanovic <mike.stepanovic@flipsidecrypto.com>
43 lines
929 B
SQL
43 lines
929 B
SQL
{{ config(
|
|
materialized = 'incremental',
|
|
incremental_strategy = 'merge',
|
|
merge_exclude_columns = ["inserted_timestamp"],
|
|
unique_key = 'complete_native_prices_id',
|
|
cluster_by = ['hour::DATE'],
|
|
tags = ['silver_prices','scheduled_core']
|
|
) }}
|
|
|
|
SELECT
|
|
HOUR,
|
|
asset_id,
|
|
symbol,
|
|
NAME,
|
|
decimals,
|
|
price,
|
|
blockchain,
|
|
is_imputed,
|
|
is_deprecated,
|
|
provider,
|
|
source,
|
|
_inserted_timestamp,
|
|
SYSDATE() AS inserted_timestamp,
|
|
SYSDATE() AS modified_timestamp,
|
|
{{ dbt_utils.generate_surrogate_key(['complete_native_prices_id']) }} AS complete_native_prices_id,
|
|
'{{ invocation_id }}' AS _invocation_id
|
|
FROM
|
|
{{ ref(
|
|
'bronze__complete_native_prices'
|
|
) }}
|
|
|
|
{% if is_incremental() %}
|
|
WHERE
|
|
modified_timestamp >= (
|
|
SELECT
|
|
MAX(
|
|
modified_timestamp
|
|
)
|
|
FROM
|
|
{{ this }}
|
|
)
|
|
{% endif %}
|