Advanced developers seeking to model user behavior gaps and session-based window merges.
Group website click logs into user session windows to measure engagement.
Save the following raw rows locally as \`dataset.csv\` to test your pipeline:
timestamp,user_id,action
1719830400,userA,login
1719830420,userA,view_item
1719830450,userA,logout
1719830700,userB,login
1719830900,userA,loginCreate a local file named \`starter.py\` and copy the following skeleton. Complete the missing transformations:
# starter.py - Session Analytics
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
def run_pipeline():
options = PipelineOptions()
with beam.Pipeline(options=options) as p:
# TODO: Setup session windows with 300s inactivity gap
# TODO: Count activities per session
pass
if __name__ == "__main__":
run_pipeline()