Skip to content

Instantly share code, notes, and snippets.

@danthelion
Last active June 27, 2022 07:10
Show Gist options
  • Save danthelion/3e2b1a35b769d604b956fb9cefb4964e to your computer and use it in GitHub Desktop.
Save danthelion/3e2b1a35b769d604b956fb9cefb4964e to your computer and use it in GitHub Desktop.
{{ config(materialized='materializedview') }}
select
server_name,
count(id)
from {{ ref('stg_event_changes') }}
WHERE mz_logical_timestamp() >= timestamp * 1000
AND mz_logical_timestamp() < timestamp * 1000 + 3600000
group by server_name
order by count desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment