From 1861c6026602eb373fb154a07435a9c58f1fdb1b Mon Sep 17 00:00:00 2001 From: soispoke <66172107+soispoke@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:54:29 +0200 Subject: [PATCH] fix incremental strategy from append to merge into (#1204) --- spellbook/models/magiceden/magiceden_trades.sql | 4 +++- spellbook/models/nft/nft_trades.sql | 4 +++- spellbook/models/opensea/opensea_trades.sql | 4 +++- .../ethereum/erc1155/transfers_ethereum_erc1155_agg_day.sql | 4 +++- .../ethereum/erc1155/transfers_ethereum_erc1155_agg_hour.sql | 4 +++- .../ethereum/erc20/transfers_ethereum_erc20_agg_day.sql | 4 +++- .../ethereum/erc20/transfers_ethereum_erc20_agg_hour.sql | 4 +++- .../ethereum/erc721/transfers_ethereum_erc721_agg_day.sql | 4 +++- .../ethereum/erc721/transfers_ethereum_erc721_agg_hour.sql | 4 +++- spellbook/models/uniswap/uniswap_trades.sql | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/spellbook/models/magiceden/magiceden_trades.sql b/spellbook/models/magiceden/magiceden_trades.sql index ea1934bb4f2..2ca1b7347c5 100644 --- a/spellbook/models/magiceden/magiceden_trades.sql +++ b/spellbook/models/magiceden/magiceden_trades.sql @@ -1,7 +1,9 @@ {{ config( alias ='trades', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_trade_id' ) }} diff --git a/spellbook/models/nft/nft_trades.sql b/spellbook/models/nft/nft_trades.sql index e34ba7e63b5..c8707c378ea 100644 --- a/spellbook/models/nft/nft_trades.sql +++ b/spellbook/models/nft/nft_trades.sql @@ -1,7 +1,9 @@ {{ config( alias ='trades', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_trade_id' ) }} diff --git a/spellbook/models/opensea/opensea_trades.sql b/spellbook/models/opensea/opensea_trades.sql index 07efdcb74a6..95ed1ed57d5 100644 --- a/spellbook/models/opensea/opensea_trades.sql +++ b/spellbook/models/opensea/opensea_trades.sql @@ -1,7 +1,9 @@ {{ config( alias ='trades', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_trade_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_day.sql b/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_day.sql index fbb76d04bb2..d1913e1d337 100644 --- a/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_day.sql +++ b/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_day.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc1155_agg_day', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_hour.sql b/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_hour.sql index a8c7813c185..b3aac359800 100644 --- a/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_hour.sql +++ b/spellbook/models/transfers/ethereum/erc1155/transfers_ethereum_erc1155_agg_hour.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc1155_agg_hour', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_day.sql b/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_day.sql index 0ef03aeca4f..b994a9c2bfd 100644 --- a/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_day.sql +++ b/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_day.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc20_agg_day', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_hour.sql b/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_hour.sql index 40c69935abf..9f82fbed790 100644 --- a/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_hour.sql +++ b/spellbook/models/transfers/ethereum/erc20/transfers_ethereum_erc20_agg_hour.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc20_agg_hour', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_day.sql b/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_day.sql index ed4f57b58ef..7aefda69032 100644 --- a/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_day.sql +++ b/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_day.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc721_agg_day', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_hour.sql b/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_hour.sql index 362a4f79266..cf6e3305d34 100644 --- a/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_hour.sql +++ b/spellbook/models/transfers/ethereum/erc721/transfers_ethereum_erc721_agg_hour.sql @@ -1,7 +1,9 @@ {{ config( alias ='erc721_agg_hour', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_transfer_id' ) }} diff --git a/spellbook/models/uniswap/uniswap_trades.sql b/spellbook/models/uniswap/uniswap_trades.sql index e135efe050e..901ea7d87b6 100644 --- a/spellbook/models/uniswap/uniswap_trades.sql +++ b/spellbook/models/uniswap/uniswap_trades.sql @@ -1,7 +1,9 @@ {{ config( alias ='trades', materialized ='incremental', - file_format ='delta' + file_format ='delta', + incremental_strategy='merge', + unique_key='unique_trade_id' ) }}