From d8fe3684d4bb2a3ff1ea47573477009b0a37d294 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Thu, 25 Jul 2024 15:36:20 +0100 Subject: [PATCH] Use events rather than sharded_events for raw_sessions backfill --- posthog/models/raw_sessions/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,