we have raw events data in clickhouse raw_events table, we want to aggregate raw events into sessions data (a single session contains multiple raw events), how do we do that with dbt incremental models. We might need to update existing sessions data as w

The problem I’m having

we have raw events data in clickhouse raw_events table, we want to aggregate raw events into sessions data (a single session contains multiple raw events), how do we do that with dbt incremental models. We might need to update existing sessions data as well as append new sessions data in sessions table as new raw_events gets processed.

The context of why I’m trying to do this

What I’ve already tried

Some example code or error messages

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML!