From 5529a39bfadc44a1fb640cf74bd2fc250425359f Mon Sep 17 00:00:00 2001 From: soispoke <66172107+soispoke@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:12:27 +0200 Subject: [PATCH] incremental tables to views finalize transition to new materialization --- .../magiceden/solana/magiceden_solana_trades.sql | 6 +----- .../opensea/ethereum/opensea_ethereum_trades.sql | 6 +----- .../models/opensea/solana/opensea_solana_trades.sql | 6 +----- .../uniswap/ethereum/uniswap_v2_ethereum_trades.sql | 12 ++---------- .../uniswap/ethereum/uniswap_v3_ethereum_trades.sql | 12 ++---------- 5 files changed, 7 insertions(+), 35 deletions(-) diff --git a/spellbook/models/magiceden/solana/magiceden_solana_trades.sql b/spellbook/models/magiceden/solana/magiceden_solana_trades.sql index 095744bddf7..ef8bdf4dd51 100644 --- a/spellbook/models/magiceden/solana/magiceden_solana_trades.sql +++ b/spellbook/models/magiceden/solana/magiceden_solana_trades.sql @@ -1,10 +1,6 @@ {{ config( - alias='trades', - materialized ='incremental', - file_format ='delta', - incremental_strategy='merge', - unique_key='unique_id' + alias='trades' ) }} diff --git a/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql b/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql index 06eccdfd30c..87142a3fea2 100644 --- a/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql +++ b/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql @@ -1,10 +1,6 @@ {{ config( - alias='trades', - materialized ='incremental', - file_format ='delta', - incremental_strategy='merge', - unique_key='unique_id' + alias='trades' ) }} diff --git a/spellbook/models/opensea/solana/opensea_solana_trades.sql b/spellbook/models/opensea/solana/opensea_solana_trades.sql index e598a845eaf..70efede1f11 100644 --- a/spellbook/models/opensea/solana/opensea_solana_trades.sql +++ b/spellbook/models/opensea/solana/opensea_solana_trades.sql @@ -1,10 +1,6 @@ {{ config( - alias='trades', - materialized ='incremental', - file_format ='delta', - incremental_strategy='merge', - unique_key='unique_id' + alias='trades' ) }} diff --git a/spellbook/models/uniswap/ethereum/uniswap_v2_ethereum_trades.sql b/spellbook/models/uniswap/ethereum/uniswap_v2_ethereum_trades.sql index 8f6906d59f6..d28cdf04378 100644 --- a/spellbook/models/uniswap/ethereum/uniswap_v2_ethereum_trades.sql +++ b/spellbook/models/uniswap/ethereum/uniswap_v2_ethereum_trades.sql @@ -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' ) }} @@ -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 %} \ No newline at end of file + AND pb.blockchain = 'ethereum' \ No newline at end of file diff --git a/spellbook/models/uniswap/ethereum/uniswap_v3_ethereum_trades.sql b/spellbook/models/uniswap/ethereum/uniswap_v3_ethereum_trades.sql index 96cc09cafb3..8dcbbf192dd 100644 --- a/spellbook/models/uniswap/ethereum/uniswap_v3_ethereum_trades.sql +++ b/spellbook/models/uniswap/ethereum/uniswap_v3_ethereum_trades.sql @@ -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 @@ -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 %} \ No newline at end of file + AND pb.blockchain = 'ethereum' \ No newline at end of file