I have event data logged in BigQuery, where I want to group the requests in the following way:
- If a request happens more than x minutes apart from the last request, start a new session
- If the session grows longer than y minutes, close the session and start a new one
The only two columns essential for defining a session (above requirements) are a user_id
column and a timestamp
of when an event took place.
The goal is to construct sessions out of individual user event streams.