Skip to content

Commit

Permalink
change partition keys and columns
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBoxer committed Jan 22, 2025
1 parent dc58dd1 commit 63dced5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FROM TABLE (
topic3,
data,
tx_hash,
index,
index as evt_index,
tx_index,
tx_from,
tx_to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WITH evt_swap AS (
, to
, contract_address
, tx_hash
, index
, evt_index
, amount0In
, amount0Out
, amount1In
Expand Down Expand Up @@ -42,7 +42,7 @@ WITH evt_swap AS (
, CASE WHEN amount0In = UINT256 '0' OR amount1Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_sold_address
, t.contract_address AS project_contract_address
, t.tx_hash
, t.index AS evt_index
, t.evt_index
, f.contract_address as factory_address
, t.tx_from
, t.tx_to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ WITH evt_swap AS (
, amount1
, contract_address
, tx_hash
, index
, tx_index
, evt_index
, tx_from
, tx_to
FROM {{ Pair_evt_Swap }}
Expand All @@ -50,7 +49,7 @@ WITH evt_swap AS (
, CASE WHEN amount0 < INT256 '0' THEN f.token1 ELSE f.token0 END AS token_sold_address
, t.contract_address as project_contract_address
, t.tx_hash
, t.index as evt_index
, t.evt_index
, f.contract_address as factory_address
, t.tx_from
, t.tx_to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'dex'
, alias = 'automated_base_trades'
, partition_by = ['block_month', 'blockchain', 'project']
, partition_by = ['block_month', 'blockchain']
, materialized = 'incremental'
, file_format = 'delta'
, incremental_strategy = 'merge'
, unique_key = ['blockchain', 'project', 'version', 'tx_hash', 'evt_index']
, unique_key = ['blockchain', 'block_number', 'index']
, incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v2_multichain',
alias = 'automated_base_trades',
partition_by = ['block_month'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['blockchain', 'tx_hash', 'evt_index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v2_multichain',
alias = 'decoded_factory_evt',
partition_by = ['block_date'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['tx_hash', 'index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v2_multichain',
alias = 'decoded_pool_evt_swap',
partition_by = ['block_date'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['tx_hash', 'index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v3_multichain',
alias = 'automated_base_trades',
partition_by = ['block_month'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['blockchain', 'tx_hash', 'evt_index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v3_multichain',
alias = 'decoded_factory_evt',
partition_by = ['block_date'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['blockchain', 'tx_hash', 'index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ config(
schema = 'uniswap_v3_multichain',
alias = 'decoded_pool_evt_swap',
partition_by = ['block_date'],
partition_by = ['block_month', 'blockchain'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['blockchain', 'tx_hash', 'index'],
unique_key = ['blockchain', 'block_number', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}
Expand Down

0 comments on commit 63dced5

Please sign in to comment.