Skip to content

Instantly share code, notes, and snippets.

@ldenson11
Created October 25, 2019 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldenson11/529d4e2a09405fb03fca4463e6172600 to your computer and use it in GitHub Desktop.
Save ldenson11/529d4e2a09405fb03fca4463e6172600 to your computer and use it in GitHub Desktop.
-- join multiple streams
select o.name,
sum(d.clicks),
hop_end(r.eventTimestamp, interval '20' second, interval '40' second)
from click_stream o join orgs r on o.org_id = r.org_id
join models d on d.org_id = r.org_id
group by o.name,
hop(r.eventTimestamp, interval '20' second, interval '40' second)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment