Created
September 28, 2023 21:01
-
-
Save slopp/9ce7f9d38219cf6593ef9e9ae1f2dd7d to your computer and use it in GitHub Desktop.
Credits Dagster OSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with events as (select distinct | |
DATE_FORMAT(timestamp, '%Y-%m') as event_month, | |
dagster_event_type, | |
coalesce(run_id, '||', step_key) as step_id, | |
count(1) as credits | |
from event_logs | |
where dagster_event_type = 'STEP_START' | |
or dagster_event_type = 'ASSET_MATERIALIZATION' | |
group by 1, 2, 3 | |
) | |
select | |
event_month, | |
sum(credits) as sum_credits | |
from events | |
group by 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment