From 2f63510db186a9fe221515eefaeaee5302e5bf7d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:00:00 +0000 Subject: [PATCH] Update query snapshots --- .../api/test/__snapshots__/test_person.ambr | 250 ++++++++++++++++++ 1 file changed, 250 insertions(+) diff --git a/posthog/api/test/__snapshots__/test_person.ambr b/posthog/api/test/__snapshots__/test_person.ambr index e210aca38191d..21a4649e3dc8e 100644 --- a/posthog/api/test/__snapshots__/test_person.ambr +++ b/posthog/api/test/__snapshots__/test_person.ambr @@ -1,4 +1,129 @@ # serializer version: 1 +# name: TestPerson.test_filter_person_email + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_email_materialized + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], "pmat_email") + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_list + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'distinct_id' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_list.1 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'another_one' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_list.2 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_list.3 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['inexistent'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPerson.test_filter_person_list.4 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'inexistent' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- # name: TestPerson.test_filter_person_prop ''' /* user_id:0 request:_snapshot_ */ @@ -406,6 +531,131 @@ LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 ''' # --- +# name: TestPersonFromClickhouse.test_filter_person_email + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_email_materialized + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], "pmat_email") + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_list + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'distinct_id' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_list.1 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'another_one' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_list.2 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['another@gmail.com'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_list.3 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND has(['inexistent'], replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '')) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- +# name: TestPersonFromClickhouse.test_filter_person_list.4 + ''' + /* user_id:0 request:_snapshot_ */ + SELECT id + FROM person + WHERE team_id = 2 + GROUP BY id + HAVING max(is_deleted) = 0 + AND argMax(person.created_at, version) < now() + INTERVAL 1 DAY + AND id IN + (SELECT person_id + FROM + (SELECT distinct_id, + argMax(person_id, version) as person_id + FROM person_distinct_id2 + WHERE team_id = 2 + GROUP BY distinct_id + HAVING argMax(is_deleted, version) = 0) + where distinct_id = 'inexistent' ) + ORDER BY argMax(person.created_at, version) DESC, id DESC + LIMIT 100 SETTINGS optimize_aggregation_in_order = 1 + ''' +# --- # name: TestPersonFromClickhouse.test_filter_person_prop ''' /* user_id:0 request:_snapshot_ */