diff --git a/posthog/models/raw_sessions/sql.py b/posthog/models/raw_sessions/sql.py index 9a144f278c2e8..f682fe3ed48c6 100644 --- a/posthog/models/raw_sessions/sql.py +++ b/posthog/models/raw_sessions/sql.py @@ -215,7 +215,7 @@ def source_int_column(column_name: str) -> str: -- replay false as maybe_has_session_replay -FROM {database}.sharded_events +FROM {database}.events WHERE bitAnd(bitShiftRight(toUInt128(accurateCastOrNull(`$session_id`, 'UUID')), 76), 0xF) == 7 -- has a session id and is valid uuidv7 """.format( database=settings.CLICKHOUSE_DATABASE,