Skip to content

Commit

Permalink
refactor: Also add version column
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Jun 21, 2024
1 parent 525c682 commit 2eabe0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion posthog/batch_exports/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
pd.distinct_id AS distinct_id,
toString(p.id) AS person_id,
p.properties AS properties,
pd.version AS version,
pd._timestamp AS _inserted_at
FROM (
SELECT
team_id,
distinct_id,
argMax(person_id, version) AS person_id,
max(version) AS version,
argMax(person_id, person_distinct_id2.version) AS person_id,
max(_timestamp) AS _timestamp
FROM
person_distinct_id2
Expand Down

0 comments on commit 2eabe0c

Please sign in to comment.