Skip to content

Commit

Permalink
incremental tables to views finalize transition to new materialization
Browse files Browse the repository at this point in the history
  • Loading branch information
soispoke committed Jun 14, 2022
1 parent 1c74d39 commit 5529a39
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{{
config(
alias='trades',
materialized ='incremental',
file_format ='delta',
incremental_strategy='merge',
unique_key='unique_id'
alias='trades'
)
}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{{
config(
alias='trades',
materialized ='incremental',
file_format ='delta',
incremental_strategy='merge',
unique_key='unique_id'
alias='trades'
)
}}

Expand Down
6 changes: 1 addition & 5 deletions spellbook/models/opensea/solana/opensea_solana_trades.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{{
config(
alias='trades',
materialized ='incremental',
file_format ='delta',
incremental_strategy='merge',
unique_key='unique_id'
alias='trades'
)
}}

Expand Down
12 changes: 2 additions & 10 deletions spellbook/models/uniswap/ethereum/uniswap_v2_ethereum_trades.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{{
config(
schema = 'uniswap_v2_ethereum',
alias='trades',
materialized ='incremental',
file_format ='delta',
incremental_strategy='merge',
unique_key='unique_id'
alias='trades'
)
}}

Expand Down Expand Up @@ -63,8 +59,4 @@ LEFT JOIN {{ source('prices', 'usd') }} pa ON pa.minute = date_trunc('minute', d
AND pa.blockchain = 'ethereum'
LEFT JOIN {{ source('prices', 'usd') }} pb ON pb.minute = date_trunc('minute', dex.block_time)
AND pb.contract_address = dex.token_b_address
AND pb.blockchain = 'ethereum'
{% if is_incremental() %}
-- this filter will only be applied on an incremental run
WHERE dex.block_time > now() - interval 2 days
{% endif %}
AND pb.blockchain = 'ethereum'
12 changes: 2 additions & 10 deletions spellbook/models/uniswap/ethereum/uniswap_v3_ethereum_trades.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{{config(schema = 'uniswap_v3_ethereum',
alias='trades',
materialized ='incremental',
file_format ='delta',
incremental_strategy='merge',
unique_key='unique_id')
alias='trades')
}}

SELECT
Expand Down Expand Up @@ -55,8 +51,4 @@ SELECT
AND pa.blockchain = 'ethereum'
LEFT JOIN {{ source('prices', 'usd') }} pb ON pb.minute = date_trunc('minute', dex.block_time)
AND pb.contract_address = dex.token_b_address
AND pb.blockchain = 'ethereum'
{% if is_incremental() %}
-- this filter will only be applied on an incremental run
WHERE dex.block_time > now() - interval 2 days
{% endif %}
AND pb.blockchain = 'ethereum'

0 comments on commit 5529a39

Please sign in to comment.