Skip to content

Commit 832fb9c

Browse files
docs(eventcounter): clarify dedup comment in goal_count.sql
DISTINCT over the selected columns collapses exact duplicate rows; it is not literally "one row per ID" if non-identical rows ever shared an ID. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cb9da03 commit 832fb9c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/eventcounter/storage/v2/dwh_database/bigquery/sql/goal_count.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ WITH deduped_events AS (
22
-- BigQuery has no primary keys, so an at-least-once Pub/Sub redelivery
33
-- can append the same event twice. Deduplicate by event ID before any
44
-- aggregation, otherwise duplicates inflate event_count and value_sum.
5-
-- Duplicates are identical rows, so DISTINCT over the used columns is
6-
-- equivalent to picking one row per ID.
5+
-- Duplicates are expected to be identical rows; DISTINCT collapses exact
6+
-- duplicates for the columns used downstream without changing the
7+
-- aggregation semantics.
78
SELECT DISTINCT
89
id,
910
user_id,

0 commit comments

Comments
 (0)