Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 2, 2022 19:08
Show Gist options
  • Save nfarah86/81aa2cce866ea0b38561d0cc1b588900 to your computer and use it in GitHub Desktop.
Save nfarah86/81aa2cce866ea0b38561d0cc1b588900 to your computer and use it in GitHub Desktop.
SELECT
*
, cast(DATE_TRUNC('HOUR', PARSE_TIMESTAMP('%a %h %d %H:%M:%S %z %Y', i.created_at)) as string) as event_date_hour
, PARSE_TIMESTAMP('%a %h %d %H:%M:%S %z %Y', i.created_at) as _event_time
, cast(i.id as string) as id
FROM
_input i
where
i.user.id is not null
and i.user.id is not undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment