-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add in burned event #5759
add in burned event #5759
Conversation
Workflow run id 8620763523 approved. |
Workflow run id 8620763610 approved. |
models/chainlink/arbitrum/chainlink_arbitrum_ccip_tokens_transferred_logs.sql
Show resolved
Hide resolved
|
||
alias='ccip_tokens_transferred_logs', | ||
materialized='view' |
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.
We can add schema in the config blocks and change the materialized strategy to incremental
.
c87dc1e
to
7056864
Compare
Workflow run id 8667978535 approved. |
Workflow run id 8667979315 approved. |
@Hosuke I added in the filter. Let me know if that looks right. |
Workflow run id 8668165095 approved. |
Workflow run id 8668165189 approved. |
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked | ||
AND block_time >= CAST('2023-07-06' AS date) | ||
{% if is_incremental() %} | ||
AND block_time >= date_trunc('day', now() - interval '{{incremental_interval}}' day) |
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.
We can use the incremental_predicate
here (and for all other incremental filters):
AND block_time >= date_trunc('day', now() - interval '{{incremental_interval}}' day) | |
AND {{ incremental_predicate('block_time') }} |
c3e799c
to
33de368
Compare
Workflow run id 8764920425 approved. |
Workflow run id 8764920460 approved. |
@Hosuke updated now with incremental_predicate |
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.
Some adjustments needed for incremental views.
config( | ||
alias='ccip_tokens_transferred_logs', |
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.
You can add the schema in all config blocks now:
config( | |
alias='ccip_tokens_transferred_logs', | |
config( | |
schema='chainlink_polygon', | |
alias='ccip_tokens_transferred_logs', |
{{ source('polygon', 'logs') }} logs | ||
WHERE | ||
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked | ||
AND block_time >= CAST('2023-07-06' AS date) |
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.
We can introduce jinja var like project_start_date
for the dates used in the sql:
i.e.
{% set project_start_date = '2023-07-06' %}
and
AND block_time >= TIMESTAMP '{{project_start_date}}'
incremental_strategy='merge', | ||
) |
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.
You need to add the unique_key
in the config blocks for incremental updates:
incremental_strategy='merge', | |
) | |
incremental_strategy='merge', | |
unique_key=['tx_hash', ...] | |
) |
Workflow run id 8766032427 approved. |
Workflow run id 8766032472 approved. |
Workflow run id 8766155664 approved. |
Workflow run id 8766155781 approved. |
Workflow run id 8766225016 approved. |
Workflow run id 8766225193 approved. |
@Hosuke added in the unique tests |
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.
LGTM.✅
Thank you @AnonJon
Sample chainlink_ccip_tokens_transferred_logs
Also please run git merge main
to update this PR.
Hi @AnonJon, please run |
46eb1f3
to
5c8d061
Compare
Workflow run id 8801655237 approved. |
Workflow run id 8801655248 approved. |
ccip_tokens_locked
toccip_tokens_transferred
burned
in events inccip_tokens_transferred
tx_hash
inccip_send_requested