make model incremental
This commit is contained in:
parent
eaf1a87ab3
commit
79345a6ab7
1 changed files with 7 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
{{ config(materialized="incremental", unique_key="id_exchange_rate") }}
|
||||
|
||||
with
|
||||
raw_exchange_rates as (select * from {{ source("xedotcom", "exchange_rates") }}),
|
||||
stg_xedotcom__exchange_rates as (
|
||||
|
|
@ -17,3 +19,8 @@ with
|
|||
)
|
||||
select *
|
||||
from stg_xedotcom__exchange_rates
|
||||
{% if is_incremental() %}
|
||||
where
|
||||
dwh_extracted_at_utc
|
||||
>= ((select max(dwh_extracted_at_utc) from {{ this }}) - interval '7 days')
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue