Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 2, 2022 19:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nfarah86/3c46cfc379fbef939084ecdc7950b374 to your computer and use it in GitHub Desktop.
SELECT
count(*) tweets,
cast(DATE_TRUNC('HOUR', PARSE_TIMESTAMP('%a %h %d %H:%M:%S %z %Y', i.created_at)) as string) as event_date_hour_str,
DATE_TRUNC('HOUR', PARSE_TIMESTAMP('%a %h %d %H:%M:%S %z %Y', i.created_at)) as event_date_hour,
cast(i.user.id as string) id,
arbitrary(i.user.name) name
FROM
_input i
where
i.user.id is not null
and i.user.id is not undefined
group by
i.user.id,
event_date_hour_str,
event_date_hour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment