Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
WHERE team_id = 2
AND event IN ['$pageview', 'user signed up']
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59') ) events
AND timestamp <= toDateTime('2020-07-01 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -399,7 +399,7 @@
WHERE team_id = 2
AND event IN ['$pageview', 'user signed up']
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59') ) events
AND timestamp <= toDateTime('2020-07-01 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -510,7 +510,7 @@
WHERE team_id = 2
AND event IN ['$pageview', 'user signed up']
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59') ) events
AND timestamp <= toDateTime('2020-07-01 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -621,7 +621,7 @@
WHERE team_id = 2
AND event IN ['$pageview', 'user signed up']
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59') ) events
AND timestamp <= toDateTime('2020-07-01 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-04-30 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand All @@ -90,7 +90,7 @@
GROUP BY entrance_period_start) data
RIGHT OUTER JOIN
(SELECT toStartOfDay(toDateTime('2021-04-30 00:00:00') + toIntervalDay(number), 'UTC') AS entrance_period_start
FROM numbers(dateDiff('day', toDateTime('2021-04-30 00:00:00'), toDateTime('2021-05-07 23:59:59')) + 1) AS period_offsets) fill USING (entrance_period_start)
FROM numbers(dateDiff('day', toDateTime('2021-04-30 00:00:00'), toDateTime('2021-05-07 00:00:00')) + 1) AS period_offsets) fill USING (entrance_period_start)
ORDER BY entrance_period_start ASC SETTINGS allow_experimental_window_functions = 1
'
---
Expand Down Expand Up @@ -176,7 +176,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-04-30 07:00:00')
AND timestamp <= toDateTime('2021-05-08 06:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 07:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand All @@ -186,7 +186,7 @@
GROUP BY entrance_period_start) data
RIGHT OUTER JOIN
(SELECT toStartOfDay(toDateTime('2021-04-30 07:00:00') + toIntervalDay(number), 'US/Pacific') AS entrance_period_start
FROM numbers(dateDiff('day', toDateTime('2021-04-30 07:00:00'), toDateTime('2021-05-08 06:59:59')) + 1) AS period_offsets) fill USING (entrance_period_start)
FROM numbers(dateDiff('day', toDateTime('2021-04-30 07:00:00'), toDateTime('2021-05-07 07:00:00')) + 1) AS period_offsets) fill USING (entrance_period_start)
ORDER BY entrance_period_start ASC SETTINGS allow_experimental_window_functions = 1
'
---
12 changes: 6 additions & 6 deletions ee/clickhouse/queries/test/__snapshots__/test_event_query.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
WHERE team_id = 2
AND event = 'viewed'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
'
---
# name: TestEventQuery.test_cohort_filter
Expand All @@ -87,7 +87,7 @@
WHERE team_id = 2
AND event = 'viewed'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (pdi.person_id IN
(select id
from
Expand Down Expand Up @@ -166,7 +166,7 @@
WHERE team_id = 2
AND event = '$pageview'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (pdi.person_id IN
(select id
from
Expand Down Expand Up @@ -194,7 +194,7 @@
WHERE team_id = 2
AND event = 'viewed'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['test_val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'some_key'), '^"|"$', '')))
'
---
Expand All @@ -206,7 +206,7 @@
WHERE team_id = 2
AND event = 'viewed'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['test_val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'some_key'), '^"|"$', '')))
'
---
Expand Down Expand Up @@ -293,7 +293,7 @@
WHERE team_id = 2
AND event = 'viewed'
AND timestamp >= toStartOfDay(toDateTime('2021-05-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (pdi.person_id IN
(SELECT person_id
FROM person_static_cohort
Expand Down
28 changes: 14 additions & 14 deletions ee/clickhouse/queries/test/__snapshots__/test_paths.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -166,7 +166,7 @@
JOIN funnel_actors ON funnel_actors.actor_id = pdi.person_id
WHERE team_id = 2
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['technology'], replaceRegexpAll(JSONExtractRaw(group_properties_0, 'industry'), '^"|"$', '')))
AND e.timestamp >= target_timestamp
ORDER BY pdi.person_id,
Expand Down Expand Up @@ -276,7 +276,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -350,7 +350,7 @@
JOIN funnel_actors ON funnel_actors.actor_id = pdi.person_id
WHERE team_id = 2
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['technology'], replaceRegexpAll(JSONExtractRaw(group_properties_0, 'industry'), '^"|"$', '')))
AND e.timestamp >= target_timestamp
ORDER BY pdi.person_id,
Expand Down Expand Up @@ -458,7 +458,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -532,7 +532,7 @@
JOIN funnel_actors ON funnel_actors.actor_id = pdi.person_id
WHERE team_id = 2
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['technology'], replaceRegexpAll(JSONExtractRaw(group_properties_0, 'industry'), '^"|"$', '')))
AND e.timestamp >= target_timestamp
ORDER BY pdi.person_id,
Expand Down Expand Up @@ -640,7 +640,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -714,7 +714,7 @@
JOIN funnel_actors ON funnel_actors.actor_id = pdi.person_id
WHERE team_id = 2
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['technology'], replaceRegexpAll(JSONExtractRaw(group_properties_0, 'industry'), '^"|"$', '')))
AND e.timestamp >= target_timestamp
ORDER BY pdi.person_id,
Expand Down Expand Up @@ -822,7 +822,7 @@
WHERE team_id = 2
AND event IN ['step one', 'step three', 'step two']
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59') ) events
AND timestamp <= toDateTime('2021-05-07 00:00:00') ) events
WHERE (step_0 = 1
OR step_1 = 1
OR step_2 = 1) ))))
Expand Down Expand Up @@ -896,7 +896,7 @@
JOIN funnel_actors ON funnel_actors.actor_id = pdi.person_id
WHERE team_id = 2
AND timestamp >= toDateTime('2021-05-01 00:00:00')
AND timestamp <= toDateTime('2021-05-07 23:59:59')
AND timestamp <= toDateTime('2021-05-07 00:00:00')
AND (has(['technology'], replaceRegexpAll(JSONExtractRaw(group_properties_0, 'industry'), '^"|"$', '')))
AND e.timestamp >= target_timestamp
ORDER BY pdi.person_id,
Expand Down Expand Up @@ -1275,7 +1275,7 @@
WHERE team_id = 2
AND (event = '$pageview')
AND timestamp >= toDateTime('2012-01-01 00:00:00')
AND timestamp <= toDateTime('2012-01-02 23:59:59')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timgl , looks like there's some differences between CH version 21.11 (on which snapshot tests ran on your PR) and 22.3 (which is the new default).

Just FYI. I'm not yet sure how these changes could've happened, but will investigate if you don't end up getting to it

AND timestamp <= toDateTime('2012-01-02 00:00:00')
ORDER BY pdi.person_id,
e.timestamp)
GROUP BY person_id) ARRAY
Expand Down Expand Up @@ -1396,7 +1396,7 @@
WHERE team_id = 2
AND (event = '$pageview')
AND timestamp >= toDateTime('2012-01-01 00:00:00')
AND timestamp <= toDateTime('2012-01-02 23:59:59')
AND timestamp <= toDateTime('2012-01-02 00:00:00')
ORDER BY pdi.person_id,
e.timestamp)
GROUP BY person_id) ARRAY
Expand Down Expand Up @@ -1517,7 +1517,7 @@
WHERE team_id = 2
AND (event = '$pageview')
AND timestamp >= toDateTime('2012-01-01 00:00:00')
AND timestamp <= toDateTime('2012-01-02 23:59:59')
AND timestamp <= toDateTime('2012-01-02 00:00:00')
ORDER BY pdi.person_id,
e.timestamp)
GROUP BY person_id) ARRAY
Expand Down Expand Up @@ -1644,7 +1644,7 @@
WHERE team_id = 2
AND (event = '$pageview')
AND timestamp >= toDateTime('2012-01-01 00:00:00')
AND timestamp <= toDateTime('2012-01-02 23:59:59')
AND timestamp <= toDateTime('2012-01-02 00:00:00')
ORDER BY pdi.person_id,
e.timestamp)
GROUP BY person_id) ARRAY
Expand Down
16 changes: 8 additions & 8 deletions ee/clickhouse/queries/test/__snapshots__/test_trends.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@
HAVING max(is_deleted) = 0) person ON person.id = pdi.person_id
WHERE team_id = 2
AND event = 'sign up'
AND timestamp >= toStartOfHour(toDateTime('2020-01-05 15:00:00'), 'US/Pacific')
AND timestamp <= toDateTime('2020-01-05 23:59:59') )
AND timestamp >= toDateTime('2020-01-05 15:00:00')
AND timestamp <= toDateTime('2020-01-05 16:00:00') )
GROUP BY actor_id
LIMIT 200
OFFSET 0
Expand Down Expand Up @@ -774,7 +774,7 @@
WHERE team_id = 2
AND event = 'sign up'
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59')
AND timestamp <= toDateTime('2020-07-01 00:00:00')
AND ((NOT (replaceRegexpAll(JSONExtractRaw(person_props, 'email'), '^"|"$', '') ILIKE '%@posthog.com%')
OR has(['val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'key'), '^"|"$', ''))))
GROUP BY value
Expand All @@ -800,7 +800,7 @@
ticks.day_start as day_start,
breakdown_value
FROM
(SELECT toStartOfDay(toDateTime('2020-07-01 23:59:59', 'UTC') - number * 86400) as day_start
(SELECT toStartOfDay(toDateTime('2020-07-01 00:00:00', 'UTC') - number * 86400) as day_start
FROM numbers(183)
UNION ALL SELECT toStartOfDay(toDateTime('2020-01-01 00:00:00', 'UTC')) as day_start) as ticks
CROSS JOIN
Expand Down Expand Up @@ -835,7 +835,7 @@
AND ((NOT (replaceRegexpAll(JSONExtractRaw(person_props, 'email'), '^"|"$', '') ILIKE '%@posthog.com%')
OR has(['val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'key'), '^"|"$', ''))))
AND timestamp >= toStartOfDay(toDateTime('2020-01-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2020-07-01 23:59:59')
AND timestamp <= toDateTime('2020-07-01 00:00:00')
AND replaceRegexpAll(JSONExtractRaw(person_props, 'email'), '^"|"$', '') in (['test2@posthog.com', 'test@gmail.com', 'test5@posthog.com', 'test4@posthog.com', 'test3@posthog.com'])
GROUP BY day_start,
breakdown_value))
Expand Down Expand Up @@ -875,7 +875,7 @@
WHERE team_id = 2
AND event = 'sign up'
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-07-01 23:59:59')
AND timestamp <= toDateTime('2020-07-01 00:00:00')
AND ((has(['val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'key'), '^"|"$', ''))))
GROUP BY value
ORDER BY count DESC
Expand All @@ -900,7 +900,7 @@
ticks.day_start as day_start,
breakdown_value
FROM
(SELECT toStartOfDay(toDateTime('2020-07-01 23:59:59', 'UTC') - number * 86400) as day_start
(SELECT toStartOfDay(toDateTime('2020-07-01 00:00:00', 'UTC') - number * 86400) as day_start
FROM numbers(183)
UNION ALL SELECT toStartOfDay(toDateTime('2020-01-01 00:00:00', 'UTC')) as day_start) as ticks
CROSS JOIN
Expand Down Expand Up @@ -935,7 +935,7 @@
AND event = 'sign up'
AND ((has(['val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'key'), '^"|"$', ''))))
AND timestamp >= toStartOfDay(toDateTime('2020-01-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2020-07-01 23:59:59')
AND timestamp <= toDateTime('2020-07-01 00:00:00')
AND replaceRegexpAll(JSONExtractRaw(person_props, 'email'), '^"|"$', '') in (['test2@posthog.com'])
GROUP BY day_start,
breakdown_value))
Expand Down
2 changes: 1 addition & 1 deletion ee/clickhouse/sql/test/__snapshots__/test_schema.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
group4_properties VARCHAR


) ENGINE = Kafka('kafka', 'clickhouse_events_json_test', 'group1', 'JSONEachRow')
) ENGINE = Kafka('kafka:9092', 'clickhouse_events_json_test', 'group1', 'JSONEachRow')

SETTINGS kafka_skip_broken_messages = 100

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
WHERE team_id = 2
AND event = '$pageview'
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-01-06 23:59:59')
AND timestamp <= toDateTime('2020-01-06 00:00:00')
AND (has(['control', 'test'], replaceRegexpAll(JSONExtractRaw(e.properties, '$feature/a-b-test'), '^"|"$', '')))
GROUP BY value
ORDER BY count DESC
Expand All @@ -34,7 +34,7 @@
ticks.day_start as day_start,
breakdown_value
FROM
(SELECT toStartOfDay(toDateTime('2020-01-06 23:59:59', 'UTC') - number * 86400) as day_start
(SELECT toStartOfDay(toDateTime('2020-01-06 00:00:00', 'UTC') - number * 86400) as day_start
FROM numbers(6)
UNION ALL SELECT toStartOfDay(toDateTime('2020-01-01 00:00:00', 'UTC')) as day_start) as ticks
CROSS JOIN
Expand All @@ -52,7 +52,7 @@
AND event = '$pageview'
AND (has(['control', 'test'], replaceRegexpAll(JSONExtractRaw(e.properties, '$feature/a-b-test'), '^"|"$', '')))
AND timestamp >= toStartOfDay(toDateTime('2020-01-01 00:00:00'), 'UTC')
AND timestamp <= toDateTime('2020-01-06 23:59:59')
AND timestamp <= toDateTime('2020-01-06 00:00:00')
AND replaceRegexpAll(JSONExtractRaw(properties, '$feature/a-b-test'), '^"|"$', '') in (['control', 'test'])
GROUP BY day_start,
breakdown_value))
Expand All @@ -75,7 +75,7 @@
WHERE team_id = 2
AND event = '$pageview_funnel'
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-01-06 23:59:59')
AND timestamp <= toDateTime('2020-01-06 00:00:00')
AND (has(['control', 'test'], replaceRegexpAll(JSONExtractRaw(e.properties, '$feature/a-b-test'), '^"|"$', '')))
GROUP BY value
ORDER BY count DESC
Expand Down Expand Up @@ -147,7 +147,7 @@
WHERE team_id = 2
AND event IN ['$pageleave_funnel', '$pageview_funnel']
AND timestamp >= toDateTime('2020-01-01 00:00:00')
AND timestamp <= toDateTime('2020-01-06 23:59:59')
AND timestamp <= toDateTime('2020-01-06 00:00:00')
AND (has(['control', 'test'], replaceRegexpAll(JSONExtractRaw(e.properties, '$feature/a-b-test'), '^"|"$', ''))) ) events
WHERE (step_0 = 1
OR step_1 = 1) ))
Expand Down
Loading