-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Clickhouse use window funnel * IPDB * Fix more issues * Sub second precision * use dict instead of Person
- Loading branch information
Showing
6 changed files
with
49 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
FUNNEL_SQL = """ | ||
SELECT id, {select_steps} FROM ( | ||
SELECT | ||
person_distinct_id.person_id as id, | ||
groupArray(events.timestamp) as timestamps, | ||
groupArray(events.event) as eventsArr, | ||
groupArray(events.uuid) as event_ids, | ||
groupArray(events.properties) as event_props, | ||
groupArray(events.distinct_id) as distinct_ids, | ||
{person_prop_alias} | ||
{steps} | ||
FROM events | ||
JOIN (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) as person_distinct_id ON person_distinct_id.distinct_id = events.distinct_id | ||
{person_prop_join} | ||
WHERE team_id = %(team_id)s {filters} {parsed_date_from} {parsed_date_to} | ||
GROUP BY person_distinct_id.person_id, team_id | ||
ORDER BY timestamps | ||
) WHERE step_0 <> toDateTime(0) | ||
person_id as id, | ||
windowFunnel(6048000000000000)(toUInt64(toUnixTimestamp64Micro(timestamp)), | ||
{steps} | ||
) | ||
FROM ( | ||
SELECT | ||
events.*, pid.person_id | ||
FROM | ||
events | ||
JOIN (SELECT person_id, distinct_id FROM person_distinct_id WHERE team_id = %(team_id)s) as pid | ||
ON pid.distinct_id = events.distinct_id | ||
WHERE team_id = %(team_id)s {filters} {parsed_date_from} {parsed_date_to} | ||
) | ||
GROUP BY person_id | ||
""" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters