-
Notifications
You must be signed in to change notification settings - Fork 73
Migrate interop ETL tasks from transforms to blockbatch daily #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
INSERT INTO transforms_interop.dim_erc20_first_seen_v1 | ||
/** | ||
Update first seen erc20 transfers. | ||
*/ | ||
|
||
SELECT | ||
chain | ||
, chain_id | ||
, contract_address | ||
|
||
-- transfers seen earlier have greater ReplacingMergeTree row_version | ||
, min(block_timestamp) AS first_seen | ||
, dateDiff('second', first_seen, '2106-01-01 00:00:00'::DATETIME) AS row_version | ||
|
||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM blockbatch.token_transfers__erc20_transfers_v1 | ||
WHERE dt = '2025-01-01' AND chain = 'base' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here |
||
) | ||
|
||
GROUP BY 1, 2, 3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
INSERT INTO transforms_interop.dim_erc20_ntt_first_seen_v1 | ||
/** | ||
Aggregated to keep only the first seen value for each token contract address. | ||
*/ | ||
|
||
SELECT | ||
chain | ||
, chain_id | ||
, contract_address | ||
|
||
-- events seen earlier have greater ReplacingMergeTree row_version | ||
, min(block_timestamp) AS first_seen | ||
, dateDiff('second', first_seen, '2106-01-01 00:00:00'::DATETIME) AS row_version | ||
|
||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM transforms_interop.fact_erc20_ntt_transfers_v1 | ||
WHERE dt = '2025-01-01' AND chain = 'base' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A bit confused on this part, but wonder why the dt and chain is set to base only on 2025-01-01? |
||
) | ||
|
||
GROUP BY 1, 2, 3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
INSERT INTO transforms_interop.dim_erc20_oft_first_seen_v1 | ||
/** | ||
Aggregated to keep only the first seen value for each token contract address. | ||
*/ | ||
|
||
SELECT | ||
chain | ||
, chain_id | ||
, contract_address | ||
|
||
-- events seen earlier have greater ReplacingMergeTree row_version | ||
, min(block_timestamp) AS first_seen | ||
, dateDiff('second', first_seen, '2106-01-01 00:00:00'::DATETIME) AS row_version | ||
|
||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM transforms_interop.fact_erc20_oft_transfers_v1 | ||
WHERE dt = '2025-01-01' AND chain = 'base' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
) | ||
|
||
GROUP BY 1, 2, 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any difference between this line 101 and 107 for inputs path?