Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(hogql): native filters hit the json index and reads drop the udf (#113523)

Sandy Spicer823a3270c684
diff --git a/docs/published/handbook/engineering/databases/hogql-python.md b/docs/published/handbook/engineering/databases/hogql-python.md
index 9a95cb348035..4d0ec965e750 100644
--- a/docs/published/handbook/engineering/databases/hogql-python.md
+++ b/docs/published/handbook/engineering/databases/hogql-python.md
@@ -160,6 +160,15 @@ If you access `poe.properties.$browser`, we will actually access the field `pers
In practice, you should avoid both and access `person.properties.$browser`, which will choose the right approach for you.
+On the native JSON events table, HogQL compares non-empty string constants directly with declared String paths and casts Dynamic paths to Nullable(String) for properties with String or unknown definition types.
+This keeps equality and membership predicates visible to the JSON skip index without failing on mixed scalar types.
+Numeric, Boolean and DateTime property definitions keep their conversions when compared with strings, for both event and person properties.
+Boolean conversion reads the native path directly because object and array text cannot match `true` or `false`; numeric conversions already read native paths directly.
+Constants starting with `[` or `{` keep the full property read because arrays and objects serialize differently from scalars.
+Single-property reads serialize sub-objects with ClickHouse's JSON formatter; whole-document reads still remove declared defaults.
+Raw SQL property readers preserve backslashes before forward slashes whether ClickHouse's `output_format_json_escape_forward_slashes` setting is enabled or disabled.
+Native queries disable forward-slash escaping so object and array text retains `/`.
+
Add new tables and fields as needed! Just make sure each table has a `team_id` column.
Internal marketing queries can read cached session dimensions from `posthog.web_sessions_dimensional_preaggregated`.
diff --git a/ee/clickhouse/queries/test/__snapshots__/test_related_actors_query.new_events_schema.ambr b/ee/clickhouse/queries/test/__snapshots__/test_related_actors_query.new_events_schema.ambr
index 3cdd15899b8d..a65518497687 100644
--- a/ee/clickhouse/queries/test/__snapshots__/test_related_actors_query.new_events_schema.ambr
+++ b/ee/clickhouse/queries/test/__snapshots__/test_related_actors_query.new_events_schema.ambr
@@ -28,7 +28,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRelatedPersonsQuery.test_query_related_people[new_events_schema.1]
@@ -50,7 +51,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRelatedPersonsQuery.test_query_related_people[new_events_schema]
@@ -79,6 +81,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/ee/clickhouse/views/test/__snapshots__/test_clickhouse_groups.new_events_schema.ambr b/ee/clickhouse/views/test/__snapshots__/test_clickhouse_groups.new_events_schema.ambr
index 4f65f7a10b3a..0bf032491f37 100644
--- a/ee/clickhouse/views/test/__snapshots__/test_clickhouse_groups.new_events_schema.ambr
+++ b/ee/clickhouse/views/test/__snapshots__/test_clickhouse_groups.new_events_schema.ambr
@@ -19,7 +19,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: GroupsViewSetTestCase.test_related_groups[new_events_schema]
@@ -49,7 +50,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: GroupsViewSetTestCase.test_related_groups_person[new_events_schema]
@@ -82,6 +84,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/api/test/__snapshots__/test_event.new_events_schema.ambr b/posthog/api/test/__snapshots__/test_event.new_events_schema.ambr
index 40e823a1031a..a3663e24a611 100644
--- a/posthog/api/test/__snapshots__/test_event.new_events_schema.ambr
+++ b/posthog/api/test/__snapshots__/test_event.new_events_schema.ambr
@@ -2,10 +2,10 @@
# name: TestEvents.test_event_property_values[new_events_schema.1]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%qw%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%qw%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -18,16 +18,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.2]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%QW%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%QW%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -40,16 +41,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.3]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -62,16 +64,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.4]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), equals(events.event, 'random event'), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), equals(events.event, 'random event'), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -84,16 +87,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.5]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), or(equals(events.event, 'foo'), equals(events.event, 'random event')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), or(equals(events.event, 'foo'), equals(events.event, 'random event')), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%6%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -106,16 +110,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.6]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), equals(events.event, '404_i_dont_exist'), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%qw%'), 0))
- ORDER BY length(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), equals(events.event, '404_i_dont_exist'), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))), '%qw%'), 0))
+ ORDER BY length(toString(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop)))))) ASC
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -128,7 +133,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values[new_events_schema.7]
@@ -155,9 +161,9 @@
# name: TestEvents.test_event_property_values[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^random_prop), '{}'), toJSONString(properties.^random_prop), if(isNull(nullIf(toString(properties.random_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.random_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_prop)), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^random_prop), '{}'), toJSONString(events.properties.^random_prop), if(isNull(nullIf(toString(events.properties.random_prop), '')), NULL, if(and(in(ascii(toString(events.properties.random_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_prop), '[]'), '{}'), toString(events.properties.random_prop))))))
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -170,15 +176,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values_with_hidden_properties[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^visible_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^visible_prop)), if(isNull(nullIf(toString(events.properties.visible_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.visible_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^visible_prop), '{}'), toJSONString(properties.^visible_prop), if(isNull(nullIf(toString(properties.visible_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.visible_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^visible_prop), '{}'), toJSONString(events.properties.^visible_prop), if(isNull(nullIf(toString(events.properties.visible_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.visible_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^visible_prop), '{}'), toJSONString(properties.^visible_prop), if(isNull(nullIf(toString(properties.visible_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.visible_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^visible_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^visible_prop)), if(isNull(nullIf(toString(events.properties.visible_prop), '')), NULL, if(and(in(ascii(toString(events.properties.visible_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.visible_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.visible_prop), '[]'), '{}'), toString(events.properties.visible_prop))))))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^visible_prop), '{}'), toJSONString(events.properties.^visible_prop), if(isNull(nullIf(toString(events.properties.visible_prop), '')), NULL, if(and(in(ascii(toString(events.properties.visible_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.visible_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.visible_prop), '[]'), '{}'), toString(events.properties.visible_prop))))))
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -191,15 +198,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEvents.test_event_property_values_without_hidden_properties[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^test_prop), '{}'), toJSONString(properties.^test_prop), if(isNull(nullIf(toString(properties.test_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.test_prop), '[]'), '{}')))`
+ SELECT DISTINCT if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'))) AS `if(notEquals(toJSONString(properties.^test_prop), '{}'), toJSONString(properties.^test_prop), if(isNull(nullIf(toString(properties.test_prop), '')), NULL, nullIf(nullIf(toJSONString(properties.test_prop), '[]'), '{}')))`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2020-01-13 00:00:00', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('2020-01-20 23:59:59', 6, 'UTC')), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 10 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -212,6 +220,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/api/test/__snapshots__/test_properties_timeline.new_events_schema.ambr b/posthog/api/test/__snapshots__/test_properties_timeline.new_events_schema.ambr
index 42fb1f13aa02..a1f628d5af05 100644
--- a/posthog/api/test/__snapshots__/test_properties_timeline.new_events_schema.ambr
+++ b/posthog/api/test/__snapshots__/test_properties_timeline.new_events_schema.ambr
@@ -13,10 +13,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -37,7 +38,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_actor_with_six_events_but_only_two_relevant_changes_without_events[new_events_schema]
@@ -54,10 +56,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -78,7 +81,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_actor_with_six_events_but_only_two_relevant_changes_without_filters[new_events_schema]
@@ -95,7 +99,8 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
'' AS relevant_property_values,
lagInFrame('') OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
@@ -119,7 +124,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_actor_with_three_events_and_return_to_previous_value[new_events_schema]
@@ -136,10 +142,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -160,7 +167,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_person_with_three_events_and_return_to_previous_value_at_single_day_point[new_events_schema]
@@ -177,10 +185,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -201,7 +210,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_person_with_three_events_and_return_to_previous_value_at_single_hour_point[new_events_schema]
@@ -218,10 +228,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -242,7 +253,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_person_with_three_events_and_return_to_previous_value_at_single_month_point[new_events_schema]
@@ -259,10 +271,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -283,7 +296,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_existing_person_with_three_events_and_return_to_previous_value_using_relative_date_from[new_events_schema]
@@ -300,10 +314,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -324,7 +339,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_new_actor_with_one_event_before_range[new_events_schema]
@@ -341,10 +357,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -365,7 +382,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_for_new_actor_with_one_event_in_range[new_events_schema]
@@ -382,10 +400,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -406,7 +425,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_with_two_events_in_range_using_breakdown[new_events_schema]
@@ -423,10 +443,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(toJSONString(events.person_properties.^foo), '{}'), toJSONString(events.person_properties.^foo), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(toJSONString(events.person_properties.^foo), '{}'), toJSONString(events.person_properties.^foo), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -447,7 +468,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonPropertiesTimeline.test_timeline_with_two_events_in_range_using_filter_on_series[new_events_schema]
@@ -464,10 +486,11 @@
ORDER BY timestamp ASC ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING) AS end_event_number
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS properties,
- toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo)))))) AS relevant_property_values,
- lagInFrame(toString(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^bar)), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^foo)), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo))))))) OVER (
- ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
+ concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS properties,
+ toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(toJSONString(events.person_properties.^foo), '{}'), toJSONString(events.person_properties.^foo), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo)))))) AS relevant_property_values,
+ lagInFrame(toString(tuple(if(notEquals(toJSONString(events.person_properties.^bar), '{}'), toJSONString(events.person_properties.^bar), if(isNull(nullIf(toString(events.person_properties.bar), '')), NULL, if(and(in(ascii(toString(events.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.bar), '[]'), '{}'), toString(events.person_properties.bar)))), if(notEquals(toJSONString(events.person_properties.^foo), '{}'), toJSONString(events.person_properties.^foo), if(isNull(nullIf(toString(events.person_properties.foo), '')), NULL, if(and(in(ascii(toString(events.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.foo), '[]'), '{}'), toString(events.person_properties.foo))))))) OVER (
+ ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous_relevant_property_values,
row_number() OVER (
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS start_event_number,
count() OVER () AS total_events
@@ -488,6 +511,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/api/test/__snapshots__/test_query.new_events_schema.ambr b/posthog/api/test/__snapshots__/test_query.new_events_schema.ambr
index 268cc4c03c83..0efd7d670c16 100644
--- a/posthog/api/test/__snapshots__/test_query.new_events_schema.ambr
+++ b/posthog/api/test/__snapshots__/test_query.new_events_schema.ambr
@@ -4,16 +4,16 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), 'test_val3'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.key, 'Nullable(String)'), 'test_val3'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
ORDER BY events.event ASC
- LIMIT 101)), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), 'test_val3'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
+ LIMIT 101)), and(ifNull(equals(CAST(events.properties.key, 'Nullable(String)'), 'test_val3'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -28,7 +28,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_event_property_filter[new_events_schema.2]
@@ -36,16 +37,16 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^path)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^path)), if(isNull(nullIf(toString(events.properties.path), '')), NULL, if(and(in(ascii(toString(events.properties.path)), tuple(91, 123)), in(ascii(toJSONString(events.properties.path)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.path), '[]'), '{}'), toString(events.properties.path))))), '%/%'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^path), '{}'), toJSONString(events.properties.^path), if(isNull(nullIf(toString(events.properties.path), '')), NULL, if(and(in(ascii(toString(events.properties.path)), tuple(91, 123)), in(ascii(toJSONString(events.properties.path)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.path), '[]'), '{}'), toString(events.properties.path))))), '%/%'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
ORDER BY events.event ASC
- LIMIT 101)), and(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^path)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^path)), if(isNull(nullIf(toString(events.properties.path), '')), NULL, if(and(in(ascii(toString(events.properties.path)), tuple(91, 123)), in(ascii(toJSONString(events.properties.path)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.path), '[]'), '{}'), toString(events.properties.path))))), '%/%'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
+ LIMIT 101)), and(ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^path), '{}'), toJSONString(events.properties.^path), if(isNull(nullIf(toString(events.properties.path), '')), NULL, if(and(in(ascii(toString(events.properties.path)), tuple(91, 123)), in(ascii(toJSONString(events.properties.path)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.path), '[]'), '{}'), toString(events.properties.path))))), '%/%'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -60,7 +61,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_event_property_filter[new_events_schema]
@@ -68,9 +70,9 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -92,7 +94,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_events_query_all_time_date[new_events_schema.1]
@@ -120,7 +123,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_events_query_all_time_date[new_events_schema.2]
@@ -148,7 +152,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_events_query_all_time_date[new_events_schema]
@@ -176,7 +181,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_full_hogql_query[new_events_schema]
@@ -184,7 +190,7 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
FROM events_json AS events
WHERE equals(events.team_id, 99999)
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
@@ -201,7 +207,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_full_hogql_query_view[new_events_schema.1]
@@ -213,7 +220,7 @@
FROM
(SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
FROM events_json AS events
WHERE equals(events.team_id, 99999)
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC) AS event_view
@@ -230,7 +237,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_full_hogql_query_view[new_events_schema]
@@ -238,7 +246,7 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key
FROM events_json AS events
WHERE equals(events.team_id, 99999)
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
@@ -254,7 +262,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_hogql_property_filter[new_events_schema.1]
@@ -262,9 +271,9 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE 0
ORDER BY events.event ASC
@@ -281,7 +290,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_hogql_property_filter[new_events_schema.2]
@@ -289,9 +299,9 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -313,7 +323,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_hogql_property_filter[new_events_schema.3]
@@ -321,16 +332,16 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), 'test_val2'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.key, 'Nullable(String)'), 'test_val2'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
ORDER BY events.event ASC
- LIMIT 101)), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), 'test_val2'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
+ LIMIT 101)), and(ifNull(equals(CAST(events.properties.key, 'Nullable(String)'), 'test_val2'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -345,7 +356,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_hogql_property_filter[new_events_schema]
@@ -353,9 +365,9 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -377,7 +389,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_person_property_filter[new_events_schema]
@@ -385,16 +398,16 @@
/* user_id:0 request:_snapshot_ */
SELECT events.event AS event,
events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
'a%sd',
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
ORDER BY events.event ASC
- LIMIT 101)), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
+ LIMIT 101)), and(ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -409,17 +422,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_property_filter_aggregations[new_events_schema.1]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ SELECT if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
count() AS `count()`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))
+ GROUP BY if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))
HAVING greater(count(), 1)
ORDER BY count() DESC
LIMIT 101
@@ -435,17 +449,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_property_filter_aggregations[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ SELECT if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
count() AS `count()`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))
+ GROUP BY if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -460,7 +475,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_select_event_person[new_events_schema]
@@ -490,28 +506,35 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_select_hogql_expressions[new_events_schema.1]
'''
/* user_id:0 request:_snapshot_ */
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`,
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`,
events.event AS event
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
- ORDER BY tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) ASC
+ ORDER BY tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) ASC
LIMIT 101)), and(less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
- ORDER BY tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) ASC
+ ORDER BY tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
@@ -525,7 +548,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_select_hogql_expressions[new_events_schema.2]
@@ -550,7 +574,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_select_hogql_expressions[new_events_schema.3]
@@ -559,7 +584,7 @@
SELECT count() AS `count()`,
events.event AS event
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'sign up'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), '%val2'), 0)), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'sign up'), ifNull(like(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))), '%val2'), 0)), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
GROUP BY events.event
ORDER BY count() DESC, events.event ASC
LIMIT 101
@@ -575,24 +600,25 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestQuery.test_select_hogql_expressions[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
+ SELECT if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) AS key,
events.event AS event,
events.distinct_id AS distinct_id,
- concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
+ concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key))))), '')) AS `concat(event, ' ', if(notEquals(toJSONString(properties.^key), '{}'), toJSONString(properties.^key), if(isNull(nullIf(toString(properties.key), '')), NULL, if(and(in(ascii(toString(properties.key)), tuple(91, 123)), in(ascii(toJSONString(properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(properties.key), '[]'), '{}'), toString(properties.key)))))`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC')))
- ORDER BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) ASC
+ ORDER BY if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) ASC
LIMIT 101)), and(less(events.timestamp, toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))))
- ORDER BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^key)), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) ASC
+ ORDER BY if(notEquals(toJSONString(events.properties.^key), '{}'), toJSONString(events.properties.^key), if(isNull(nullIf(toString(events.properties.key), '')), NULL, if(and(in(ascii(toString(events.properties.key)), tuple(91, 123)), in(ascii(toJSONString(events.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.key), '[]'), '{}'), toString(events.properties.key)))) ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
@@ -606,6 +632,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/dags/tests/test_data_deletion_requests.py b/posthog/dags/tests/test_data_deletion_requests.py
index 48f955f50854..a818d486055c 100644
--- a/posthog/dags/tests/test_data_deletion_requests.py
+++ b/posthog/dags/tests/test_data_deletion_requests.py
@@ -3270,7 +3270,7 @@ def test_delete_person_profiles_op_raises_only_when_the_person_is_still_live(fai
('{"$groups":{"custom_group":"g"}}', "$groups", 1),
('{"$browser":""}', "$browser", 0),
('{"custom":""}', "custom", 0),
- ('{"custom":{"a":""}}', "custom", 0),
+ ('{"custom":{"a":""}}', "custom", 1),
('{"custom":{"a":"y"}}', "custom", 1),
],
)
diff --git a/posthog/hogql/database/schema/test/__snapshots__/test_groups_revenue_analytics.new_events_schema.ambr b/posthog/hogql/database/schema/test/__snapshots__/test_groups_revenue_analytics.new_events_schema.ambr
index 774e2ceb11d5..7fe6e7b4a9c4 100644
--- a/posthog/hogql/database/schema/test/__snapshots__/test_groups_revenue_analytics.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/test/__snapshots__/test_groups_revenue_analytics.new_events_schema.ambr
@@ -35,73 +35,73 @@
toTimeZone(events.timestamp,
'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
+ events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
+ if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider,
+ accurateCastOrNull(1,
+ 'Decimal64(10)'), accurateCastOrNull(100,
+ 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount,
+ currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
+ 'Decimal64(10)'), if(equals('USD',
+ 'USD'), toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(0,
+ 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(1,
+ 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -136,73 +136,73 @@
toTimeZone(events.timestamp,
'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
+ events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
+ if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider,
+ accurateCastOrNull(1,
+ 'Decimal64(10)'), accurateCastOrNull(100,
+ 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount,
+ currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
+ 'Decimal64(10)'), if(equals('USD',
+ 'USD'), toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(0,
+ 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(1,
+ 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -244,73 +244,73 @@
toTimeZone(events.timestamp,
'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
+ events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
+ if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider,
+ accurateCastOrNull(1,
+ 'Decimal64(10)'), accurateCastOrNull(100,
+ 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount,
+ currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
+ 'Decimal64(10)'), if(equals('USD',
+ 'USD'), toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(0,
+ 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(1,
+ 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -360,17 +360,17 @@
FROM (
SELECT if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- NULL AS product_id,
- min(toTimeZone(events.timestamp,
- 'UTC')) AS min_timestamp,
- max(toTimeZone(events.timestamp,
- 'UTC')) AS max_timestamp,
- addDays(max_timestamp,
- 45.0) AS max_timestamp_plus_dropoff_days
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
+ if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ NULL AS product_id,
+ min(toTimeZone(events.timestamp,
+ 'UTC')) AS min_timestamp,
+ max(toTimeZone(events.timestamp,
+ 'UTC')) AS max_timestamp,
+ addDays(max_timestamp,
+ 45.0) AS max_timestamp_plus_dropoff_days
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -421,7 +421,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestGroupsRevenueAnalytics.test_get_revenue_for_events[new_events_schema]
@@ -466,7 +467,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -512,7 +513,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -565,7 +566,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -626,7 +627,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestGroupsRevenueAnalytics.test_query_revenue_analytics_table_events[new_events_schema]
@@ -634,396 +636,200 @@
SELECT groups_revenue_analytics.group_key AS group_key,
groups_revenue_analytics.revenue AS revenue,
groups_revenue_analytics.mrr AS mrr
- FROM (
- SELECT 99999 AS team_id,
- coalesce(revenue_agg.group_key,
- mrr_agg.group_key) AS group_key,
- coalesce(revenue_agg.revenue,
- accurateCastOrNull(0,
- 'Decimal64(10)')) AS revenue,
- coalesce(mrr_agg.mrr,
- accurateCastOrNull(0,
- 'Decimal64(10)')) AS mrr
- FROM (
- SELECT arrayJoin([revenue_analytics_revenue_item.group_0_key, revenue_analytics_revenue_item.group_1_key, revenue_analytics_revenue_item.group_2_key, revenue_analytics_revenue_item.group_3_key, revenue_analytics_revenue_item.group_4_key]) AS group_key,
- sum(revenue_analytics_revenue_item.amount) AS revenue
- FROM (
- SELECT toString(events.uuid) AS id,
+ FROM
+ (SELECT 99999 AS team_id,
+ coalesce(revenue_agg.group_key, mrr_agg.group_key) AS group_key,
+ coalesce(revenue_agg.revenue, accurateCastOrNull(0, 'Decimal64(10)')) AS revenue,
+ coalesce(mrr_agg.mrr, accurateCastOrNull(0, 'Decimal64(10)')) AS mrr
+ FROM
+ (SELECT arrayJoin([revenue_analytics_revenue_item.group_0_key, revenue_analytics_revenue_item.group_1_key, revenue_analytics_revenue_item.group_2_key, revenue_analytics_revenue_item.group_3_key, revenue_analytics_revenue_item.group_4_key]) AS group_key,
+ sum(revenue_analytics_revenue_item.amount) AS revenue
+ FROM
+ (SELECT toString(events.uuid) AS id,
toString(events.uuid) AS invoice_item_id,
+ 'revenue_analytics.events.purchase' AS source_label,
+ toTimeZone(events.timestamp, 'UTC') AS timestamp,
+ timestamp AS created_at,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ FROM events_json AS events
+ LEFT OUTER JOIN
+ (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
+ person_distinct_id_overrides.distinct_id AS distinct_id
+ FROM person_distinct_id_overrides
+ WHERE equals(person_distinct_id_overrides.team_id, 99999)
+ GROUP BY person_distinct_id_overrides.distinct_id
+ HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, 'purchase'), 1, isNotNull(amount)))
+ ORDER BY timestamp DESC) AS revenue_analytics_revenue_item
+ WHERE notEmpty(group_key)
+ GROUP BY group_key) AS revenue_agg
+ FULL OUTER JOIN
+ (SELECT customer_to_group.group_key AS group_key,
+ sum(coalesce(mrr_by_customer.mrr, accurateCastOrNull(0, 'Decimal64(10)'))) AS mrr
+ FROM
+ (SELECT DISTINCT revenue_analytics_revenue_item.customer_id AS customer_id,
+ arrayJoin([revenue_analytics_revenue_item.group_0_key, revenue_analytics_revenue_item.group_1_key, revenue_analytics_revenue_item.group_2_key, revenue_analytics_revenue_item.group_3_key, revenue_analytics_revenue_item.group_4_key]) AS group_key
+ FROM
+ (SELECT toString(events.uuid) AS id,
+ toString(events.uuid) AS invoice_item_id,
+ 'revenue_analytics.events.purchase' AS source_label,
+ toTimeZone(events.timestamp, 'UTC') AS timestamp,
+ timestamp AS created_at,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ FROM events_json AS events
+ LEFT OUTER JOIN
+ (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
+ person_distinct_id_overrides.distinct_id AS distinct_id
+ FROM person_distinct_id_overrides
+ WHERE equals(person_distinct_id_overrides.team_id, 99999)
+ GROUP BY person_distinct_id_overrides.distinct_id
+ HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, 'purchase'), 1, isNotNull(amount)))
+ ORDER BY timestamp DESC) AS revenue_analytics_revenue_item
+ WHERE notEmpty(group_key)) AS customer_to_group
+ LEFT JOIN
+ (SELECT `revenue_analytics.events.purchase.mrr_events_revenue_view`.customer_id AS customer_id,
+ sum(`revenue_analytics.events.purchase.mrr_events_revenue_view`.mrr) AS mrr
+ FROM
+ (SELECT union.source_label AS source_label,
+ union.customer_id AS customer_id,
+ union.subscription_id AS subscription_id,
+ argMax(union.amount, union.timestamp) AS mrr
+ FROM
+ (SELECT revenue_item.source_label AS source_label,
+ revenue_item.customer_id AS customer_id,
+ revenue_item.subscription_id AS subscription_id,
+ toStartOfMonth(toTimeZone(revenue_item.timestamp, 'UTC')) AS timestamp,
+ sum(revenue_item.amount) AS amount
+ FROM
+ (SELECT toString(events.uuid) AS id,
+ toString(events.uuid) AS invoice_item_id,
'revenue_analytics.events.purchase' AS source_label,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
- FROM events_json AS events
- LEFT OUTER JOIN (
- SELECT argMax(person_distinct_id_overrides.person_id,
- person_distinct_id_overrides.version) AS person_id,
- person_distinct_id_overrides.distinct_id AS distinct_id
- FROM person_distinct_id_overrides
- WHERE equals(person_distinct_id_overrides.team_id,
- 99999)
- GROUP BY person_distinct_id_overrides.distinct_id
- HAVING equals(argMax(person_distinct_id_overrides.is_deleted,
- person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,
- events__override.distinct_id)
- WHERE and(equals(events.team_id,
- 99999), and(equals(events.event,
- 'purchase'), 1,
- isNotNull(amount)))
- ORDER BY timestamp DESC) AS revenue_analytics_revenue_item
- WHERE notEmpty(group_key)
- GROUP BY group_key) AS revenue_agg
- FULL OUTER JOIN (
- SELECT customer_to_group.group_key AS group_key,
- sum(coalesce(mrr_by_customer.mrr,
- accurateCastOrNull(0,
- 'Decimal64(10)'))) AS mrr
- FROM (
- SELECT DISTINCT revenue_analytics_revenue_item.customer_id AS customer_id,
- arrayJoin([revenue_analytics_revenue_item.group_0_key, revenue_analytics_revenue_item.group_1_key, revenue_analytics_revenue_item.group_2_key, revenue_analytics_revenue_item.group_3_key, revenue_analytics_revenue_item.group_4_key]) AS group_key
- FROM (
- SELECT toString(events.uuid) AS id,
- toString(events.uuid) AS invoice_item_id,
+ toTimeZone(events.timestamp, 'UTC') AS timestamp,
+ timestamp AS created_at,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ NULL AS product_id,
+ toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
+ events.properties.`$group_0` AS group_0_key,
+ events.properties.`$group_1` AS group_1_key,
+ events.properties.`$group_2` AS group_2_key,
+ events.properties.`$group_3` AS group_3_key,
+ events.properties.`$group_4` AS group_4_key,
+ NULL AS invoice_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ toString(events.properties.`$session_id`) AS session_id,
+ events.event AS event_name,
+ NULL AS coupon,
+ coupon AS coupon_id,
+ 'USD' AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ FROM events_json AS events
+ LEFT OUTER JOIN
+ (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
+ person_distinct_id_overrides.distinct_id AS distinct_id
+ FROM person_distinct_id_overrides
+ WHERE equals(person_distinct_id_overrides.team_id, 99999)
+ GROUP BY person_distinct_id_overrides.distinct_id
+ HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, 'purchase'), 1, isNotNull(amount)))
+ ORDER BY timestamp DESC) AS revenue_item
+ WHERE and(revenue_item.is_recurring, isNotNull(revenue_item.subscription_id), ifNull(greaterOrEquals(timestamp, toStartOfMonth(addDays(toDateTime64('explicit_redacted_timestamp', 6, 'UTC'), -60))), 0), ifNull(lessOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), 0))
+ GROUP BY revenue_item.source_label,
+ revenue_item.customer_id,
+ revenue_item.subscription_id, timestamp
+ ORDER BY timestamp DESC
+ UNION ALL SELECT `revenue_analytics.events.purchase.subscription_events_revenue_view`.source_label AS source_label,
+ `revenue_analytics.events.purchase.subscription_events_revenue_view`.customer_id AS customer_id,
+ `revenue_analytics.events.purchase.subscription_events_revenue_view`.id AS subscription_id,
+ toTimeZone(`revenue_analytics.events.purchase.subscription_events_revenue_view`.ended_at, 'UTC') AS timestamp,
+ accurateCastOrNull(0, 'Decimal64(10)') AS amount
+ FROM
+ (SELECT subscription_id AS id,
'revenue_analytics.events.purchase' AS source_label,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
- FROM events_json AS events
- LEFT OUTER JOIN (
- SELECT argMax(person_distinct_id_overrides.person_id,
- person_distinct_id_overrides.version) AS person_id,
- person_distinct_id_overrides.distinct_id AS distinct_id
- FROM person_distinct_id_overrides
- WHERE equals(person_distinct_id_overrides.team_id,
- 99999)
- GROUP BY person_distinct_id_overrides.distinct_id
- HAVING equals(argMax(person_distinct_id_overrides.is_deleted,
- person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,
- events__override.distinct_id)
- WHERE and(equals(events.team_id,
- 99999), and(equals(events.event,
- 'purchase'), 1,
- isNotNull(amount)))
- ORDER BY timestamp DESC) AS revenue_analytics_revenue_item
- WHERE notEmpty(group_key)) AS customer_to_group
- LEFT JOIN (
- SELECT `revenue_analytics.events.purchase.mrr_events_revenue_view`.customer_id AS customer_id,
- sum(`revenue_analytics.events.purchase.mrr_events_revenue_view`.mrr) AS mrr
- FROM (
- SELECT union.source_label AS source_label,
- union.customer_id AS customer_id,
- union.subscription_id AS subscription_id,
- argMax(union.amount,
- union.timestamp) AS mrr
- FROM (
- SELECT revenue_item.source_label AS source_label,
- revenue_item.customer_id AS customer_id,
- revenue_item.subscription_id AS subscription_id,
- toStartOfMonth(toTimeZone(revenue_item.timestamp,
- 'UTC')) AS timestamp,
- sum(revenue_item.amount) AS amount
- FROM (
- SELECT toString(events.uuid) AS id,
- toString(events.uuid) AS invoice_item_id,
- 'revenue_analytics.events.purchase' AS source_label,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
- NULL AS product_id,
- toString(if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id)) AS customer_id,
- events.properties.`$group_0` AS group_0_key,
- events.properties.`$group_1` AS group_1_key,
- events.properties.`$group_2` AS group_2_key,
- events.properties.`$group_3` AS group_3_key,
- events.properties.`$group_4` AS group_4_key,
- NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- toString(events.properties.`$session_id`) AS session_id,
- events.event AS event_name,
- NULL AS coupon,
- coupon AS coupon_id,
- 'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
- FROM events_json AS events
- LEFT OUTER JOIN (
- SELECT argMax(person_distinct_id_overrides.person_id,
- person_distinct_id_overrides.version) AS person_id,
- person_distinct_id_overrides.distinct_id AS distinct_id
- FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id,
- 99999)
- GROUP BY person_distinct_id_overrides.distinct_id
- HAVING equals(argMax(person_distinct_id_overrides.is_deleted,
- person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,
- events__override.distinct_id)
- WHERE and(equals(events.team_id,
- 99999), and(equals(events.event,
- 'purchase'), 1,
- isNotNull(amount)))
- ORDER BY timestamp DESC) AS revenue_item
- WHERE and(revenue_item.is_recurring,
- isNotNull(revenue_item.subscription_id), ifNull(greaterOrEquals(timestamp, toStartOfMonth(addDays(toDateTime64('explicit_redacted_timestamp',
- 6,
- 'UTC'), -60))), 0), ifNull(lessOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp',
- 6,
- 'UTC')), 0))
- GROUP BY revenue_item.source_label,
- revenue_item.customer_id,
- revenue_item.subscription_id, timestamp
- ORDER BY timestamp DESC
- UNION ALL
- SELECT `revenue_analytics.events.purchase.subscription_events_revenue_view`.source_label AS source_label,
- `revenue_analytics.events.purchase.subscription_events_revenue_view`.customer_id AS customer_id,
- `revenue_analytics.events.purchase.subscription_events_revenue_view`.id AS subscription_id,
- toTimeZone(`revenue_analytics.events.purchase.subscription_events_revenue_view`.ended_at,
- 'UTC') AS timestamp,
- accurateCastOrNull(0,
- 'Decimal64(10)') AS amount
- FROM (
- SELECT subscription_id AS id,
- 'revenue_analytics.events.purchase' AS source_label,
- NULL AS plan_id,
- product_id AS product_id,
- toString(person_id) AS customer_id,
- NULL AS status,
- min_timestamp AS started_at,
- if(greater(max_timestamp_plus_dropoff_days,
- today()), NULL,
- max_timestamp_plus_dropoff_days) AS ended_at,
- NULL AS metadata
- FROM (
- SELECT if(not(empty(events__override.distinct_id)), events__override.person_id,
- events.person_id) AS person_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL,
- if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
- NULL AS product_id,
- min(toTimeZone(events.timestamp,
- 'UTC')) AS min_timestamp,
- max(toTimeZone(events.timestamp,
- 'UTC')) AS max_timestamp,
- addDays(max_timestamp,
- 45.0) AS max_timestamp_plus_dropoff_days
- FROM events_json AS events
- LEFT OUTER JOIN (
- SELECT argMax(person_distinct_id_overrides.person_id,
- person_distinct_id_overrides.version) AS person_id,
- person_distinct_id_overrides.distinct_id AS distinct_id
- FROM person_distinct_id_overrides
- WHERE equals(person_distinct_id_overrides.team_id,
- 99999)
- GROUP BY person_distinct_id_overrides.distinct_id
- HAVING equals(argMax(person_distinct_id_overrides.is_deleted,
- person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id,
- events__override.distinct_id)
- WHERE and(equals(events.team_id,
- 99999), and(1,
- isNotNull(subscription_id)))
- GROUP BY subscription_id,
- person_id)
- ORDER BY started_at DESC) AS `revenue_analytics.events.purchase.subscription_events_revenue_view`
- WHERE and(ifNull(greaterOrEquals(timestamp, toStartOfMonth(addDays(toDateTime64('explicit_redacted_timestamp',
- 6,
- 'UTC'), -60))), 0), ifNull(lessOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp',
- 6,
- 'UTC')), 0))
- ORDER BY timestamp DESC) AS
- union
- GROUP BY source_label,
- customer_id,
- subscription_id
- ORDER BY customer_id ASC,
- subscription_id ASC) AS `revenue_analytics.events.purchase.mrr_events_revenue_view`
- GROUP BY customer_id) AS mrr_by_customer ON equals(customer_to_group.customer_id,
- mrr_by_customer.customer_id)
- GROUP BY group_key) AS mrr_agg ON equals(revenue_agg.group_key,
- mrr_agg.group_key)) AS groups_revenue_analytics
+ NULL AS plan_id,
+ product_id AS product_id,
+ toString(person_id) AS customer_id,
+ NULL AS status,
+ min_timestamp AS started_at,
+ if(greater(max_timestamp_plus_dropoff_days, today()), NULL, max_timestamp_plus_dropoff_days) AS ended_at,
+ NULL AS metadata
+ FROM
+ (SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ NULL AS product_id,
+ min(toTimeZone(events.timestamp, 'UTC')) AS min_timestamp,
+ max(toTimeZone(events.timestamp, 'UTC')) AS max_timestamp,
+ addDays(max_timestamp, 45.0) AS max_timestamp_plus_dropoff_days
+ FROM events_json AS events
+ LEFT OUTER JOIN
+ (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
+ person_distinct_id_overrides.distinct_id AS distinct_id
+ FROM person_distinct_id_overrides
+ WHERE equals(person_distinct_id_overrides.team_id, 99999)
+ GROUP BY person_distinct_id_overrides.distinct_id
+ HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
+ WHERE and(equals(events.team_id, 99999), and(1, isNotNull(subscription_id)))
+ GROUP BY subscription_id,
+ person_id)
+ ORDER BY started_at DESC) AS `revenue_analytics.events.purchase.subscription_events_revenue_view`
+ WHERE and(ifNull(greaterOrEquals(timestamp, toStartOfMonth(addDays(toDateTime64('explicit_redacted_timestamp', 6, 'UTC'), -60))), 0), ifNull(lessOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), 0))
+ ORDER BY timestamp DESC) AS
+ union
+ GROUP BY source_label,
+ customer_id,
+ subscription_id
+ ORDER BY customer_id ASC,
+ subscription_id ASC) AS `revenue_analytics.events.purchase.mrr_events_revenue_view`
+ GROUP BY customer_id) AS mrr_by_customer ON equals(customer_to_group.customer_id, mrr_by_customer.customer_id)
+ GROUP BY group_key) AS mrr_agg ON equals(revenue_agg.group_key, mrr_agg.group_key)) AS groups_revenue_analytics
ORDER BY groups_revenue_analytics.group_key ASC
LIMIT 100 SETTINGS format_csv_allow_double_quotes=1,
readonly=2,
@@ -1038,6 +844,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql/database/schema/test/__snapshots__/test_persons.new_events_schema.ambr b/posthog/hogql/database/schema/test/__snapshots__/test_persons.new_events_schema.ambr
index e60a71b48208..d36a548a563d 100644
--- a/posthog/hogql/database/schema/test/__snapshots__/test_persons.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/test/__snapshots__/test_persons.new_events_schema.ambr
@@ -27,7 +27,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonIdPushdown.test_pushdown_restricts_persons_subquery_to_events_in_window[new_events_schema]
@@ -75,7 +76,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonOptimization.test_joins_are_left_alone_for_now[new_events_schema]
@@ -113,6 +115,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql/database/schema/test/__snapshots__/test_persons_revenue_analytics.new_events_schema.ambr b/posthog/hogql/database/schema/test/__snapshots__/test_persons_revenue_analytics.new_events_schema.ambr
index 34e72f1ae9ac..61acd1550494 100644
--- a/posthog/hogql/database/schema/test/__snapshots__/test_persons_revenue_analytics.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/test/__snapshots__/test_persons_revenue_analytics.new_events_schema.ambr
@@ -88,7 +88,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -141,7 +141,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -204,7 +204,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_person_id_joins_directly_against_persons_id_0_events[new_events_schema]
@@ -292,7 +293,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -345,7 +346,7 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -408,7 +409,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_query_revenue_analytics_table_events[new_events_schema]
@@ -476,7 +478,7 @@
'revenue_analytics.events.purchase' AS source_label,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
NULL AS product_id,
toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
events.properties.`$group_0` AS group_0_key,
@@ -485,13 +487,13 @@
events.properties.`$group_3` AS group_3_key,
events.properties.`$group_4` AS group_4_key,
NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
toString(events.properties.`$session_id`) AS session_id,
events.event AS event_name,
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -529,7 +531,7 @@
'revenue_analytics.events.purchase' AS source_label,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id))))) AS is_recurring,
NULL AS product_id,
toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
events.properties.`$group_0` AS group_0_key,
@@ -538,13 +540,13 @@
events.properties.`$group_3` AS group_3_key,
events.properties.`$group_4` AS group_4_key,
NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
toString(events.properties.`$session_id`) AS session_id,
events.event AS event_name,
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
in(original_currency,
['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
@@ -583,7 +585,7 @@
NULL AS metadata
FROM
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription_id)), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
+ if(notEquals(toJSONString(events.properties.^subscription_id), '{}'), toJSONString(events.properties.^subscription_id), if(isNull(nullIf(toString(events.properties.subscription_id), '')), NULL, if(and(in(ascii(toString(events.properties.subscription_id)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription_id)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription_id), '[]'), '{}'), toString(events.properties.subscription_id)))) AS subscription_id,
NULL AS product_id,
min(toTimeZone(events.timestamp, 'UTC')) AS min_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS max_timestamp,
@@ -626,7 +628,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_revenue_aggregated_per_person_across_event_and_warehouse_sources[new_events_schema]
@@ -660,7 +663,7 @@
LEFT JOIN (
SELECT revenue_analytics_revenue_item.customer_id AS customer_id, sum(revenue_analytics_revenue_item.amount) AS revenue
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'GBP' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'GBP' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -678,7 +681,7 @@
FROM (
SELECT revenue_item.source_label AS source_label, revenue_item.customer_id AS customer_id, revenue_item.subscription_id AS subscription_id, toStartOfMonth(toTimeZone(revenue_item.timestamp, 'UTC')) AS timestamp, sum(revenue_item.amount) AS amount
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'GBP' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'GBP' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -773,7 +776,7 @@
WHERE ifNull(notEquals(person_id, accurateCastOrNull('00000000-0000-0000-0000-000000000000', 'UUID')), isNotNull(person_id)
or isNotNull(accurateCastOrNull('00000000-0000-0000-0000-000000000000', 'UUID')))
GROUP BY person_id) AS persons_revenue_analytics
- LIMIT 100 SETTINGS format_csv_allow_double_quotes=1, readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ LIMIT 100 SETTINGS format_csv_allow_double_quotes=1, readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_0_disabled[new_events_schema.1]
@@ -833,7 +836,7 @@
LEFT JOIN (
SELECT revenue_analytics_revenue_item.customer_id AS customer_id, sum(revenue_analytics_revenue_item.amount) AS revenue
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(events__pdi.person_id) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(events__pdi.person_id) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
INNER JOIN (
SELECT argMax(person_distinct_id2.person_id, person_distinct_id2.version) AS person_id, person_distinct_id2.distinct_id AS distinct_id
@@ -851,7 +854,7 @@
FROM (
SELECT revenue_item.source_label AS source_label, revenue_item.customer_id AS customer_id, revenue_item.subscription_id AS subscription_id, toStartOfMonth(toTimeZone(revenue_item.timestamp, 'UTC')) AS timestamp, sum(revenue_item.amount) AS amount
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(events__pdi.person_id) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(events__pdi.person_id) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
INNER JOIN (
SELECT argMax(person_distinct_id2.person_id, person_distinct_id2.version) AS person_id, person_distinct_id2.distinct_id AS distinct_id
@@ -886,7 +889,7 @@
WHERE arrayExists(x -> isNotNull(x), breakdown_value)
GROUP BY breakdown_value
ORDER BY if(has(breakdown_value, '$$_posthog_breakdown_other_$$'), 2, if(has(breakdown_value, '$$_posthog_breakdown_null_$$'), 1, 0)) ASC, arraySum(total) DESC, breakdown_value ASC
- LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_0_disabled[new_events_schema]
@@ -907,7 +910,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_1_person_id_no_override_properties_on_events[new_events_schema.1]
@@ -1040,51 +1044,51 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
+ if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider,
+ accurateCastOrNull(1,
+ 'Decimal64(10)'), accurateCastOrNull(100,
+ 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount,
+ currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
+ 'Decimal64(10)'), if(equals('USD',
+ 'USD'), toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(0,
+ 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(1,
+ 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)))))) AS amount
FROM events_json AS events
WHERE and(equals(events.team_id,
99999), and(equals(events.event,
@@ -1131,51 +1135,51 @@
NULL AS coupon,
coupon AS coupon_id,
'USD' AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
- if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
- in(original_currency,
- ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
- if(enable_currency_aware_divider,
- accurateCastOrNull(1,
- 'Decimal64(10)'), accurateCastOrNull(100,
- 'Decimal64(10)')) AS currency_aware_divider,
- divideDecimal(original_amount,
- currency_aware_divider) AS currency_aware_amount,
- 'USD' AS currency,
- if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
- 'Decimal64(10)'), if(equals('USD',
- 'USD'), toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(0,
- 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
- 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)) = 0,
- toDecimal128(1,
- 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)), toDecimal64(0,
- 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
- 'rate',
- 'USD',
- toDate(toTimeZone(events.timestamp,
- 'UTC')), toDecimal64(0,
- 10)))))) AS amount
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL,
+ if(and(in(ascii(toString(events.properties.revenue)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ in(original_currency,
+ ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider,
+ if(enable_currency_aware_divider,
+ accurateCastOrNull(1,
+ 'Decimal64(10)'), accurateCastOrNull(100,
+ 'Decimal64(10)')) AS currency_aware_divider,
+ divideDecimal(original_amount,
+ currency_aware_divider) AS currency_aware_amount,
+ 'USD' AS currency,
+ if(isNull('USD'), accurateCastOrNull(currency_aware_amount,
+ 'Decimal64(10)'), if(equals('USD',
+ 'USD'), toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(0,
+ 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount,
+ 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)) = 0,
+ toDecimal128(1,
+ 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)), toDecimal64(0,
+ 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`,
+ 'rate',
+ 'USD',
+ toDate(toTimeZone(events.timestamp,
+ 'UTC')), toDecimal64(0,
+ 10)))))) AS amount
FROM events_json AS events
WHERE and(equals(events.team_id,
99999), and(equals(events.event,
@@ -1274,7 +1278,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_1_person_id_no_override_properties_on_events[new_events_schema]
@@ -1295,7 +1300,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_2_person_id_override_properties_on_events[new_events_schema.1]
@@ -1343,7 +1349,7 @@
LEFT JOIN (
SELECT revenue_analytics_revenue_item.customer_id AS customer_id, sum(revenue_analytics_revenue_item.amount) AS revenue
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1361,7 +1367,7 @@
FROM (
SELECT revenue_item.source_label AS source_label, revenue_item.customer_id AS customer_id, revenue_item.subscription_id AS subscription_id, toStartOfMonth(toTimeZone(revenue_item.timestamp, 'UTC')) AS timestamp, sum(revenue_item.amount) AS amount
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1396,7 +1402,7 @@
WHERE arrayExists(x -> isNotNull(x), breakdown_value)
GROUP BY breakdown_value
ORDER BY if(has(breakdown_value, '$$_posthog_breakdown_other_$$'), 2, if(has(breakdown_value, '$$_posthog_breakdown_null_$$'), 1, 0)) ASC, arraySum(total) DESC, breakdown_value ASC
- LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_2_person_id_override_properties_on_events[new_events_schema]
@@ -1417,7 +1423,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_3_person_id_override_properties_joined[new_events_schema.1]
@@ -1477,7 +1484,7 @@
LEFT JOIN (
SELECT revenue_analytics_revenue_item.customer_id AS customer_id, sum(revenue_analytics_revenue_item.amount) AS revenue
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1495,7 +1502,7 @@
FROM (
SELECT revenue_item.source_label AS source_label, revenue_item.customer_id AS customer_id, revenue_item.subscription_id AS subscription_id, toStartOfMonth(toTimeZone(revenue_item.timestamp, 'UTC')) AS timestamp, sum(revenue_item.amount) AS amount
FROM (
- SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ SELECT toString(events.uuid) AS id, toString(events.uuid) AS invoice_item_id, 'revenue_analytics.events.purchase' AS source_label, toTimeZone(events.timestamp, 'UTC') AS timestamp, timestamp AS created_at, 0 AS is_recurring, NULL AS product_id, toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id, events.properties.`$group_0` AS group_0_key, events.properties.`$group_1` AS group_1_key, events.properties.`$group_2` AS group_2_key, events.properties.`$group_3` AS group_3_key, events.properties.`$group_4` AS group_4_key, NULL AS invoice_id, NULL AS subscription_id, toString(events.properties.`$session_id`) AS session_id, events.event AS event_name, NULL AS coupon, coupon AS coupon_id, 'USD' AS original_currency, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount, in(original_currency, ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'UGX', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']) AS enable_currency_aware_divider, if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider, divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount, 'USD' AS currency, if(isNull('USD'), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals('USD', 'USD'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'USD', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1530,7 +1537,7 @@
WHERE arrayExists(x -> isNotNull(x), breakdown_value)
GROUP BY breakdown_value
ORDER BY if(has(breakdown_value, '$$_posthog_breakdown_other_$$'), 2, if(has(breakdown_value, '$$_posthog_breakdown_null_$$'), 1, 0)) ASC, arraySum(total) DESC, breakdown_value ASC
- LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ LIMIT 50000 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalytics.test_virtual_property_in_trend_3_person_id_override_properties_joined[new_events_schema]
@@ -1551,7 +1558,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_0_disabled[new_events_schema.1]
@@ -1690,7 +1698,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_0_disabled[new_events_schema]
@@ -1711,7 +1720,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_1_person_id_no_override_properties_on_events[new_events_schema.1]
@@ -1835,7 +1845,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_1_person_id_no_override_properties_on_events[new_events_schema]
@@ -1856,7 +1867,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_2_person_id_override_properties_on_events[new_events_schema.1]
@@ -1987,7 +1999,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_2_person_id_override_properties_on_events[new_events_schema]
@@ -2008,7 +2021,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_3_person_id_override_properties_joined[new_events_schema.1]
@@ -2146,7 +2160,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonsRevenueAnalyticsManagedViewsets.test_virtual_property_in_trend_3_person_id_override_properties_joined[new_events_schema]
@@ -2167,6 +2182,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql/database/schema/test/__snapshots__/test_session_replay_events.new_events_schema.ambr b/posthog/hogql/database/schema/test/__snapshots__/test_session_replay_events.new_events_schema.ambr
index f1aaa70c99fa..b99026790faf 100644
--- a/posthog/hogql/database/schema/test/__snapshots__/test_session_replay_events.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/test/__snapshots__/test_session_replay_events.new_events_schema.ambr
@@ -22,7 +22,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFilterSessionReplaysByEvents.test_select_by_event_property[new_events_schema]
@@ -30,7 +31,7 @@
SELECT DISTINCT session_replay_events.session_id AS session_id
FROM session_replay_events
JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))) AS `properties___$current_url`,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))) AS `properties___$current_url`,
events.properties.`$session_id` AS `$session_id`
FROM events_json AS events PREWHERE greaterOrEquals(events.timestamp, toDateTime64(minus(toDateTime64('today', 6, 'UTC'), toIntervalDay(90)), 6, 'UTC'))
WHERE equals(events.team_id, 99999)) AS raw_session_replay_events__events ON equals(session_replay_events.session_id, raw_session_replay_events__events.`$session_id`)
@@ -48,7 +49,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFilterSessionReplaysByEvents.test_select_by_subquery_on_event_property_without_join[new_events_schema]
@@ -58,7 +60,7 @@
WHERE and(equals(session_replay_events.team_id, 99999), globalIn(session_replay_events.session_id,
(SELECT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%example.com%'), 0)))))
+ WHERE and(equals(events.team_id, 99999), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%example.com%'), 0)))))
ORDER BY session_replay_events.session_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -72,7 +74,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFilterSessionReplaysByEvents.test_select_event_property[new_events_schema]
@@ -81,7 +84,7 @@
any(raw_session_replay_events__events.`properties___$current_url`) AS `any(events.properties.$current_url)`
FROM session_replay_events
JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))) AS `properties___$current_url`,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))) AS `properties___$current_url`,
events.properties.`$session_id` AS `$session_id`
FROM events_json AS events PREWHERE greaterOrEquals(events.timestamp, toDateTime64(minus(toDateTime64('today', 6, 'UTC'), toIntervalDay(90)), 6, 'UTC'))
WHERE equals(events.team_id, 99999)) AS raw_session_replay_events__events ON equals(session_replay_events.session_id, raw_session_replay_events__events.`$session_id`)
@@ -100,7 +103,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFilterSessionReplaysByPerson.test_select_by_event_person[new_events_schema]
@@ -108,7 +112,7 @@
SELECT DISTINCT session_replay_events.session_id AS session_id
FROM session_replay_events
JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^person_property)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^person_property)), if(isNull(nullIf(toString(events.person_properties.person_property), '')), NULL, if(and(in(ascii(toString(events.person_properties.person_property)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.person_property)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.person_property), '[]'), '{}'), toString(events.person_properties.person_property)))) AS poe___properties___person_property,
+ (SELECT if(notEquals(toJSONString(events.person_properties.^person_property), '{}'), toJSONString(events.person_properties.^person_property), if(isNull(nullIf(toString(events.person_properties.person_property), '')), NULL, if(and(in(ascii(toString(events.person_properties.person_property)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.person_property)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.person_property), '[]'), '{}'), toString(events.person_properties.person_property)))) AS poe___properties___person_property,
events.properties.`$session_id` AS `$session_id`
FROM events_json AS events PREWHERE greaterOrEquals(events.timestamp, toDateTime64(minus(toDateTime64('today', 6, 'UTC'), toIntervalDay(90)), 6, 'UTC'))
WHERE equals(events.team_id, 99999)) AS raw_session_replay_events__events ON equals(session_replay_events.session_id, raw_session_replay_events__events.`$session_id`)
@@ -126,6 +130,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql/database/schema/test/__snapshots__/test_sessions_v3.new_events_schema.ambr b/posthog/hogql/database/schema/test/__snapshots__/test_sessions_v3.new_events_schema.ambr
index 4bd6eeb91d67..75813d68e013 100644
--- a/posthog/hogql/database/schema/test/__snapshots__/test_sessions_v3.new_events_schema.ambr
+++ b/posthog/hogql/database/schema/test/__snapshots__/test_sessions_v3.new_events_schema.ambr
@@ -22,7 +22,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsV3.test_event_sessions_where_event_timestamp[new_events_schema]
@@ -48,7 +49,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsV3.test_persons_and_sessions_on_events[new_events_schema]
@@ -83,7 +85,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsV3.test_session_dot_channel_type[new_events_schema]
@@ -112,6 +115,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql/database/test/__snapshots__/test_database.new_events_schema.ambr b/posthog/hogql/database/test/__snapshots__/test_database.new_events_schema.ambr
index faef7cfffe41..51d39a8ce63e 100644
--- a/posthog/hogql/database/test/__snapshots__/test_database.new_events_schema.ambr
+++ b/posthog/hogql/database/test/__snapshots__/test_database.new_events_schema.ambr
@@ -9,7 +9,7 @@
SELECT groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE equals(groups.team_id, 420)
- GROUP BY groups.group_type_index, groups.group_key) AS groups) AS events__some_field ON equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), events__some_field.events__some_field___key)
+ GROUP BY groups.group_type_index, groups.group_key) AS groups) AS events__some_field ON equals(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), events__some_field.events__some_field___key)
WHERE equals(events.team_id, 420)
LIMIT 50000
'''
@@ -24,7 +24,7 @@
SELECT groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE equals(groups.team_id, 420)
- GROUP BY groups.group_type_index, groups.group_key) AS groups) AS events__some_field ON equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), events__some_field.events__some_field___key)
+ GROUP BY groups.group_type_index, groups.group_key) AS groups) AS events__some_field ON equals(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), events__some_field.events__some_field___key)
WHERE equals(events.team_id, 420)
LIMIT 50000
'''
diff --git a/posthog/hogql/functions/test/__snapshots__/test_action.new_events_schema.ambr b/posthog/hogql/functions/test/__snapshots__/test_action.new_events_schema.ambr
index 07aa1e071ed2..acc14de62772 100644
--- a/posthog/hogql/functions/test/__snapshots__/test_action.new_events_schema.ambr
+++ b/posthog/hogql/functions/test/__snapshots__/test_action.new_events_schema.ambr
@@ -7,9 +7,9 @@
FROM
events_json AS e
WHERE
- and(equals(e.team_id, 99999), equals(e.event, %(hogql_val_0)s), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), %(hogql_val_1)s), 0))
+ and(equals(e.team_id, 99999), equals(e.event, %(hogql_val_0)s), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), %(hogql_val_1)s), 0))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
diff --git a/posthog/hogql/functions/test/__snapshots__/test_cohort.new_events_schema.ambr b/posthog/hogql/functions/test/__snapshots__/test_cohort.new_events_schema.ambr
index 922281254479..3bfd688d589b 100644
--- a/posthog/hogql/functions/test/__snapshots__/test_cohort.new_events_schema.ambr
+++ b/posthog/hogql/functions/test/__snapshots__/test_cohort.new_events_schema.ambr
@@ -11,7 +11,7 @@
GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
HAVING greater(sum(cohortpeople.sign), 0))), equals(events.event, %(hogql_val_0)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -37,7 +37,7 @@
GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
HAVING greater(sum(cohortpeople.sign), 0))), equals(events.event, %(hogql_val_0)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -61,7 +61,7 @@
FROM person_static_cohort
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX)))))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -83,7 +83,7 @@
FROM person_static_cohort
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX)))))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
diff --git a/posthog/hogql/functions/udfs.py b/posthog/hogql/functions/udfs.py
index 7b651e7ae3e0..368509dea093 100644
--- a/posthog/hogql/functions/udfs.py
+++ b/posthog/hogql/functions/udfs.py
@@ -31,7 +31,6 @@ UDFS: dict[str, HogQLFunctionMeta] = {
# JSONDropKeys is an executable UDF like the funnel UDFs, but it is printer-internal (restricted-property blob
# stripping), not HogQL-exposed, so it lives outside UDFS. Its deployed name is versioned the same way.
JSON_DROP_KEYS_CLICKHOUSE_NAME = "JSONDropKeys"
-JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME = "JSONStripEmptyStringsAndNulls"
# We want CI to fail if there is a breaking change and the version hasn't been incremented
if is_cloud() or is_ci():
diff --git a/posthog/hogql/printer/base.py b/posthog/hogql/printer/base.py
index 7e44e9314b76..b796aedf340d 100644
--- a/posthog/hogql/printer/base.py
+++ b/posthog/hogql/printer/base.py
@@ -1691,6 +1691,8 @@ class BasePrinter(Visitor[str]):
return f"toFloat64({self.visit(node.expr)})"
case "text" | "varchar" | "char" | "string":
return f"toString({self.visit(node.expr)})"
+ case "nullable(string)":
+ return f"CAST({self.visit(node.expr)}, 'Nullable(String)')"
case "boolean" | "bool":
return f"accurateCastOrNull({self.visit(node.expr)}, 'Bool')"
case "date":
diff --git a/posthog/hogql/printer/clickhouse.py b/posthog/hogql/printer/clickhouse.py
index b130cafbc5f0..f3abf07618bd 100644
--- a/posthog/hogql/printer/clickhouse.py
+++ b/posthog/hogql/printer/clickhouse.py
@@ -34,13 +34,10 @@ from posthog.hogql.escape_sql import (
from posthog.hogql.functions import ADD_OR_NULL_DATETIME_FUNCTIONS, FIRST_ARG_DATETIME_FUNCTIONS
from posthog.hogql.functions.embed_text import resolve_embed_text
from posthog.hogql.functions.prompt_jev import is_decision_call
-from posthog.hogql.functions.udfs import (
- JSON_DROP_KEYS_CLICKHOUSE_NAME,
- JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME,
-)
+from posthog.hogql.functions.udfs import JSON_DROP_KEYS_CLICKHOUSE_NAME
from posthog.hogql.helpers.timestamp_visitor import parse_zoned_datetime_string
from posthog.hogql.printer.base import BasePrinter, get_channel_definition_dict, resolve_field_type
-from posthog.hogql.printer.events_json_document import event_document_sql, json_member_pairs_sql
+from posthog.hogql.printer.events_json_document import event_document_sql, json_document_sql, person_document_sql
from posthog.hogql.printer.hogql import HogQLPrinter
from posthog.hogql.restricted_properties import (
RESTRICTABLE_JSON_BLOB_COLUMNS,
@@ -399,6 +396,9 @@ class ClickHousePrinter(BasePrinter):
# Re-inserted so it prints after the global settings rather than at the field's declared position.
merged.pop("json_type_escape_dots_in_keys", None)
merged["json_type_escape_dots_in_keys"] = True
+ if self._reads_native_events_table:
+ # Property sub-objects and arrays must retain the slashes returned by legacy reads.
+ merged["output_format_json_escape_forward_slashes"] = False
if self.context.emit_top_level_settings:
printed = self._print_settings(merged)
if printed is not None:
@@ -591,9 +591,11 @@ class ClickHousePrinter(BasePrinter):
serialized = event_document_sql(
field_sql, temporary_properties_sql, self._document_feature_flags_sql(type, field_sql)
)
+ elif resolved_field.name == "person_properties":
+ serialized = person_document_sql(field_sql)
else:
- serialized = f"concat('{{', arrayStringConcat({json_member_pairs_sql(field_sql)}, ','), '}}')"
- return f"{JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME}({serialized})"
+ serialized = json_document_sql(field_sql)
+ return serialized
def _document_feature_flags_sql(self, type: ast.FieldType, field_sql: str) -> str | None:
"""The `$feature_flags` map without restricted flags, or None when a restricted `$feature_flags` hides them all."""
@@ -614,8 +616,6 @@ class ClickHousePrinter(BasePrinter):
if node.name != "toJSONString" or len(node.args) != 1:
return None
arg = node.args[0]
- if isinstance(arg, ast.JsonSubcolumnAccess) and arg.access_type == "sub_object":
- return f"{JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME}(toJSONString({self.visit(arg)}))"
arg_type = resolve_field_type(arg)
if not isinstance(arg_type, ast.FieldType):
return None
diff --git a/posthog/hogql/printer/events_json_document.py b/posthog/hogql/printer/events_json_document.py
index 4a29b82c6dfc..113102cd90d6 100644
--- a/posthog/hogql/printer/events_json_document.py
+++ b/posthog/hogql/printer/events_json_document.py
@@ -16,7 +16,7 @@ from posthog.hogql.constants import (
)
from posthog.hogql.escape_sql import escape_clickhouse_string
-from posthog.clickhouse.events_json import EVENTS_PROPERTIES_JSON_SUBCOLUMNS
+from posthog.clickhouse.events_json import EVENTS_PROPERTIES_JSON_SUBCOLUMNS, PERSON_PROPERTIES_JSON_SUBCOLUMNS
def declared_array_paths(subcolumns: dict[str, str]) -> tuple[str, ...]:
@@ -24,21 +24,40 @@ def declared_array_paths(subcolumns: dict[str, str]) -> tuple[str, ...]:
return tuple(sorted(path for path, declared_type in subcolumns.items() if declared_type.startswith("Array(")))
+def declared_string_paths(subcolumns: dict[str, str]) -> tuple[str, ...]:
+ """The declared paths of a JSON column whose type is a plain or LowCardinality string."""
+ return tuple(
+ sorted(
+ path for path, declared_type in subcolumns.items() if declared_type in ("String", "LowCardinality(String)")
+ )
+ )
+
+
EVENTS_PROPERTIES_DECLARED_ARRAY_PATHS = declared_array_paths(EVENTS_PROPERTIES_JSON_SUBCOLUMNS)
+EVENTS_PROPERTIES_DECLARED_STRING_PATHS = declared_string_paths(EVENTS_PROPERTIES_JSON_SUBCOLUMNS)
+PERSON_PROPERTIES_DECLARED_STRING_PATHS = declared_string_paths(PERSON_PROPERTIES_JSON_SUBCOLUMNS)
def json_member_pairs_sql(
- document_sql: str, *, exclude_key: str | None = None, declared_array_paths: Iterable[str] = ()
+ document_sql: str,
+ *,
+ exclude_key: str | None = None,
+ declared_array_paths: Iterable[str] = (),
+ declared_string_paths: Iterable[str] = (),
) -> str:
"""`"key":<raw json>` strings for the members of a JSON column.
- The JSON type materializes a declared array path as `[]` on every row, so for those paths an empty array means
- the key was absent and the pair is left out. An empty array under any other key was sent and stays.
+ The JSON type materializes a declared path on every row, as `[]` for an array and `''` for a string, so under
+ those keys an empty value means the key was absent and the pair is left out. An empty array or string under any
+ other key was sent and stays; the cleaner already removed nulls at insert, so nothing else is filtered.
"""
conditions = []
array_paths = ", ".join(escape_clickhouse_string(path) for path in declared_array_paths)
if array_paths:
conditions.append(f"not (kv.2 = '[]' and kv.1 in ({array_paths}))")
+ string_paths = ", ".join(escape_clickhouse_string(path) for path in declared_string_paths)
+ if string_paths:
+ conditions.append(f"not (kv.2 = '\"\"' and kv.1 in ({string_paths}))")
if exclude_key is not None:
conditions.append(f"kv.1 != {escape_clickhouse_string(exclude_key)}")
members = f"JSONExtractKeysAndValuesRaw(toJSONString({document_sql}))"
@@ -72,8 +91,26 @@ def feature_flag_pairs_sql(feature_flags_sql: str) -> str:
return f"arrayConcat({flag_pairs}, {active_pair})"
+def json_document_sql(
+ document_sql: str,
+ *,
+ declared_array_paths: Iterable[str] = (),
+ declared_string_paths: Iterable[str] = (),
+) -> str:
+ """A JSON column as document text, built from its member pairs so declared defaults can be left out."""
+ pairs = json_member_pairs_sql(
+ document_sql, declared_array_paths=declared_array_paths, declared_string_paths=declared_string_paths
+ )
+ return f"concat('{{', arrayStringConcat({pairs}, ','), '}}')"
+
+
+def person_document_sql(person_properties_sql: str) -> str:
+ """The person properties column as document text, without the declared string defaults."""
+ return json_document_sql(person_properties_sql, declared_string_paths=PERSON_PROPERTIES_DECLARED_STRING_PATHS)
+
+
def event_document_sql(properties_sql: str, temporary_properties_sql: str, feature_flags_sql: str | None) -> str:
- """The rebuilt document as JSON text. The caller wraps it in the strip UDF and any restricted-key masking.
+ """The rebuilt document as JSON text. The caller wraps it in any restricted-key masking.
`feature_flags_sql` is the flags map to rebuild from, already filtered of restricted flags, or None when every
flag is hidden. The `$feature_flags` member of `properties` is left out because its entries come back as
@@ -81,7 +118,10 @@ def event_document_sql(properties_sql: str, temporary_properties_sql: str, featu
"""
pairs = [
json_member_pairs_sql(
- properties_sql, exclude_key="$feature_flags", declared_array_paths=EVENTS_PROPERTIES_DECLARED_ARRAY_PATHS
+ properties_sql,
+ exclude_key="$feature_flags",
+ declared_array_paths=EVENTS_PROPERTIES_DECLARED_ARRAY_PATHS,
+ declared_string_paths=EVENTS_PROPERTIES_DECLARED_STRING_PATHS,
)
]
if feature_flags_sql is not None:
diff --git a/posthog/hogql/printer/test/__snapshots__/test_printer.new_events_schema.ambr b/posthog/hogql/printer/test/__snapshots__/test_printer.new_events_schema.ambr
index 9098e07a6abf..ba9234a7ece4 100644
--- a/posthog/hogql/printer/test/__snapshots__/test_printer.new_events_schema.ambr
+++ b/posthog/hogql/printer/test/__snapshots__/test_printer.new_events_schema.ambr
@@ -3,7 +3,7 @@
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(concat(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), ''), ''), 'foo'))
+ WHERE and(equals(events.team_id, 99999), equals(concat(ifNull(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), ''), ''), 'foo'))
LIMIT 100 SETTINGS force_data_skipping_indices='bloom_filter_mat_test_prop',
readonly=2,
max_execution_time=60,
@@ -17,14 +17,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_force_data_skipping_indices_works_with_simple_equality[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'foo'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), 'foo'), 0))
LIMIT 100 SETTINGS force_data_skipping_indices='bloom_filter_mat_test_prop',
readonly=2,
max_execution_time=60,
@@ -38,14 +39,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -59,14 +61,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -80,14 +83,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -101,14 +105,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -122,14 +127,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -143,14 +149,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -164,14 +171,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -185,14 +193,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -206,14 +215,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -227,14 +237,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -248,14 +259,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -269,14 +281,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_0_no_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -290,14 +303,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -311,14 +325,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -332,14 +347,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -353,14 +369,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -374,14 +391,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -395,14 +413,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -416,14 +435,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -437,14 +457,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -458,14 +479,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -479,14 +501,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -500,14 +523,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -521,14 +545,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -542,14 +567,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -563,14 +589,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -584,14 +611,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -605,14 +633,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -626,14 +655,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -647,14 +677,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -668,14 +699,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -689,14 +721,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -710,14 +743,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -731,14 +765,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -752,14 +787,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -773,14 +809,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -794,14 +831,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -815,14 +853,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -836,14 +875,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -857,14 +897,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -878,14 +919,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -899,14 +941,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -920,14 +963,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -941,14 +985,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -962,14 +1007,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -983,14 +1029,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1004,14 +1051,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1025,14 +1073,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_3_nullable_mat_col_with_ngram_lower[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1046,14 +1095,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1067,14 +1117,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1088,14 +1139,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1109,14 +1161,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1130,14 +1183,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1151,14 +1205,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1172,14 +1227,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%null%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1193,14 +1249,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1214,14 +1271,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1235,14 +1293,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1256,14 +1315,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(notILike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), ''), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1277,14 +1337,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_ilike_and_not_ilike_optimization_gives_correct_results_4_non_nullable_mat_col_with_ngram_lower[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_ilike_test'), ifNull(ilike(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '%@posthog.com'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1298,14 +1359,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1319,14 +1381,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1340,14 +1403,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.12]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1361,14 +1425,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.13]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1382,14 +1447,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.14]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1403,14 +1469,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.15]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1424,14 +1491,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1445,14 +1513,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1466,14 +1535,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1487,14 +1557,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1508,14 +1579,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1529,14 +1601,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1550,14 +1623,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1571,14 +1645,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1592,14 +1667,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1613,14 +1689,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_0_no_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1634,14 +1711,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1655,14 +1733,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1676,14 +1755,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.12]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1697,14 +1777,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.13]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1718,14 +1799,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.14]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1739,14 +1821,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.15]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1760,14 +1843,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1781,14 +1865,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1802,14 +1887,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1823,14 +1909,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1844,14 +1931,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1865,14 +1953,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1886,14 +1975,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1907,14 +1997,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1928,14 +2019,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1949,14 +2041,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_1_nullable_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1970,14 +2063,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -1991,14 +2085,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2012,14 +2107,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.12]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2033,14 +2129,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.13]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2054,14 +2151,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.14]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2075,14 +2173,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.15]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2096,14 +2195,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2117,14 +2217,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2138,14 +2239,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2159,14 +2261,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2180,14 +2283,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2201,14 +2305,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2222,14 +2327,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2243,14 +2349,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2264,14 +2371,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2285,14 +2393,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_2_non_nullable_mat_col[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2306,14 +2415,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2327,14 +2437,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2348,14 +2459,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.12]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2369,14 +2481,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.13]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2390,14 +2503,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.14]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2411,14 +2525,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.15]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2432,14 +2547,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2453,14 +2569,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2474,14 +2591,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2495,14 +2613,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2516,14 +2635,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2537,14 +2657,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2558,14 +2679,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2579,14 +2701,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2600,14 +2723,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2621,14 +2745,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_3_nullable_mat_col_with_bloom_filter[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2642,14 +2767,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.10]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2663,14 +2789,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.11]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2684,14 +2811,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.12]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2705,14 +2833,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.13]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2726,14 +2855,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.14]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2747,14 +2877,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.15]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', '')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2768,14 +2899,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2789,14 +2921,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.2]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2810,14 +2943,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.3]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]', 'other_value')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]', 'other_value')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2831,14 +2965,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.4]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2852,14 +2987,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.5]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2873,14 +3009,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.6]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2894,14 +3031,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.7]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2915,14 +3053,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.8]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2936,14 +3075,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema.9]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('null', 'NULL')), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('null', 'NULL')), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2957,14 +3097,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_in_and_not_in_optimization_gives_correct_results_4_non_nullable_mat_col_with_bloom_filter[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('[email protected]')))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_in_test'), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('[email protected]')))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2978,14 +3119,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_optimization_handles_null_and_sentinel_rows_0_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), ifNull(notIn(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), ifNull(notIn(lower(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2999,14 +3141,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_optimization_handles_null_and_sentinel_rows_0_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), in(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), in(lower(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3020,14 +3163,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_optimization_handles_null_and_sentinel_rows_1_non_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), ifNull(notIn(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), ifNull(notIn(lower(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3041,14 +3185,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_optimization_handles_null_and_sentinel_rows_1_non_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), in(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_lower_in_test'), in(lower(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[email protected]'))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3062,14 +3207,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_uses_bloom_filter_lower_index_on_events[new_events_schema]
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_lower_bloom_events_test'), in(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^email)), if(isNull(nullIf(toString(events.properties.email), '')), NULL, if(and(in(ascii(toString(events.properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.email), '[]'), '{}'), toString(events.properties.email))))), ['[email protected]', '[email protected]']))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_lower_bloom_events_test'), in(lower(if(notEquals(toJSONString(events.properties.^email), '{}'), toJSONString(events.properties.^email), if(isNull(nullIf(toString(events.properties.email), '')), NULL, if(and(in(ascii(toString(events.properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.email), '[]'), '{}'), toString(events.properties.email))))), ['[email protected]', '[email protected]']))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -3082,14 +3228,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_lower_in_uses_ngram_lower_index_on_events[new_events_schema]
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_lower_ngram_events_test'), in(lower(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^email)), if(isNull(nullIf(toString(events.properties.email), '')), NULL, if(and(in(ascii(toString(events.properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.email), '[]'), '{}'), toString(events.properties.email))))), ['[email protected]', '[email protected]']))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_lower_ngram_events_test'), in(lower(if(notEquals(toJSONString(events.properties.^email), '{}'), toJSONString(events.properties.^email), if(isNull(nullIf(toString(events.properties.email), '')), NULL, if(and(in(ascii(toString(events.properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.email), '[]'), '{}'), toString(events.properties.email))))), ['[email protected]', '[email protected]']))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -3102,14 +3249,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_optimization_returns_correct_results_0_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'target_value'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(notEquals(CAST(events.properties.test_prop, 'Nullable(String)'), 'target_value'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3123,14 +3271,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_optimization_returns_correct_results_0_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'target_value'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), 'target_value'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3144,14 +3293,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_optimization_returns_correct_results_1_not_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'target_value'), 1))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(notEquals(CAST(events.properties.test_prop, 'Nullable(String)'), 'target_value'), 1))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3165,14 +3315,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_optimization_returns_correct_results_1_not_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'target_value'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_eq_test'), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), 'target_value'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3186,14 +3337,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_range_optimization_returns_correct_results_0_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(greaterOrEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(greaterOrEquals(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3207,14 +3359,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_range_optimization_returns_correct_results_0_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3228,14 +3381,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_range_optimization_returns_correct_results_1_not_nullable[new_events_schema.1]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(greaterOrEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(greaterOrEquals(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3249,14 +3403,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_materialized_column_range_optimization_returns_correct_results_1_not_nullable[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'mat_col_opt_range_test'), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -3270,7 +3425,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_person_property_is_not_set_behavior_0_materialized_joined[new_events_schema]
@@ -3312,15 +3468,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_person_property_is_not_set_behavior_1_materialized_on_events[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))) AS email_value,
- isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))) AS is_not_set_result,
- or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), not(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))))) AS is_not_set_result_historical
+ if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))) AS email_value,
+ isNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))) AS is_not_set_result,
+ or(isNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), not(isNotNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))))) AS is_not_set_result_historical
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), equals(events.event, 'is_not_set_test'))
ORDER BY distinct_id ASC
@@ -3336,7 +3493,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_person_property_is_not_set_behavior_2_not_materialized_joined[new_events_schema]
@@ -3378,15 +3536,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMaterializedColumnOptimization.test_person_property_is_not_set_behavior_3_not_materialized_on_events[new_events_schema]
'''
SELECT events.distinct_id AS distinct_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))) AS email_value,
- isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))) AS is_not_set_result,
- or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), not(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))))) AS is_not_set_result_historical
+ if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))) AS email_value,
+ isNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))) AS is_not_set_result,
+ or(isNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), not(isNotNull(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))))) AS is_not_set_result_historical
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), equals(events.event, 'is_not_set_test'))
ORDER BY distinct_id ASC
@@ -3402,7 +3561,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPrinter.test_large_pretty_print[new_events_schema]
@@ -3477,10 +3637,10 @@
'''
# ---
# name: TestPrinter.test_projection_pushdown_nested_subqueries_0_with_optimize_projections[new_events_schema]
- "SELECT outer.event AS event FROM (SELECT inner.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS inner) AS outer LIMIT 50000"
+ "SELECT outer.event AS event FROM (SELECT inner.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), '{}'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS inner) AS outer LIMIT 50000"
# ---
# name: TestPrinter.test_projection_pushdown_nested_subqueries_1_without_optimize_projections[new_events_schema]
- 'SELECT outer.event AS event FROM (SELECT inner.uuid AS uuid, inner.event AS event, inner.properties AS properties, inner.timestamp AS timestamp, inner.distinct_id AS distinct_id, inner.elements_chain AS elements_chain, inner.created_at AS created_at, inner.`$session_id` AS `$session_id`, inner.`$window_id` AS `$window_id`, inner.person_mode AS person_mode, inner.person_id AS person_id, inner.`$group_0` AS `$group_0`, inner.`$group_1` AS `$group_1`, inner.`$group_2` AS `$group_2`, inner.`$group_3` AS `$group_3`, inner.`$group_4` AS `$group_4`, inner.elements_chain_href AS elements_chain_href, inner.elements_chain_texts AS elements_chain_texts, inner.elements_chain_ids AS elements_chain_ids, inner.elements_chain_elements AS elements_chain_elements, inner.event_issue_id AS event_issue_id, inner.issue_id AS issue_id, inner.issue_id_v2 AS issue_id_v2, inner.issue_name AS issue_name, inner.issue_description AS issue_description, inner.issue_status AS issue_status, inner.issue_assigned_user_id AS issue_assigned_user_id, inner.issue_assigned_role_id AS issue_assigned_role_id, inner.issue_first_seen AS issue_first_seen FROM (SELECT events.uuid AS uuid, events.event AS event, JSONStripEmptyStringsAndNulls(concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\')) AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS inner) AS outer LIMIT 50000'
+ 'SELECT outer.event AS event FROM (SELECT inner.uuid AS uuid, inner.event AS event, inner.properties AS properties, inner.timestamp AS timestamp, inner.distinct_id AS distinct_id, inner.elements_chain AS elements_chain, inner.created_at AS created_at, inner.`$session_id` AS `$session_id`, inner.`$window_id` AS `$window_id`, inner.person_mode AS person_mode, inner.person_id AS person_id, inner.`$group_0` AS `$group_0`, inner.`$group_1` AS `$group_1`, inner.`$group_2` AS `$group_2`, inner.`$group_3` AS `$group_3`, inner.`$group_4` AS `$group_4`, inner.elements_chain_href AS elements_chain_href, inner.elements_chain_texts AS elements_chain_texts, inner.elements_chain_ids AS elements_chain_ids, inner.elements_chain_elements AS elements_chain_elements, inner.event_issue_id AS event_issue_id, inner.issue_id AS issue_id, inner.issue_id_v2 AS issue_id_v2, inner.issue_name AS issue_name, inner.issue_description AS issue_description, inner.issue_status AS issue_status, inner.issue_assigned_user_id AS issue_assigned_user_id, inner.issue_assigned_role_id AS issue_assigned_role_id, inner.issue_first_seen AS issue_first_seen FROM (SELECT events.uuid AS uuid, events.event AS event, concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and not (kv.2 = \'""\' and kv.1 in (\'$browser\', \'$browser_language\', \'$browser_version\', \'$config_defaults\', \'$device_type\', \'$geoip_city_name\', \'$geoip_continent_code\', \'$geoip_continent_name\', \'$geoip_country_code\', \'$geoip_country_name\', \'$geoip_subdivision_1_name\', \'$geoip_time_zone\', \'$group_0\', \'$group_1\', \'$group_2\', \'$group_3\', \'$group_4\', \'$lib\', \'$lib_version\', \'$os\', \'$os_version\', \'$session_id\', \'$timezone\', \'$window_id\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\') AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), \'{}\'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), \'{}\'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS inner) AS outer LIMIT 50000'
# ---
# name: TestPrinter.test_projection_pushdown_no_asterisk_unchanged_0_with_optimize_projections[new_events_schema]
'SELECT sub.event AS event FROM (SELECT events.event AS event, events.distinct_id AS distinct_id FROM events_json AS events WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000'
@@ -3489,22 +3649,22 @@
'SELECT sub.event AS event FROM (SELECT events.event AS event, events.distinct_id AS distinct_id FROM events_json AS events WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000'
# ---
# name: TestPrinter.test_projection_pushdown_preserves_join_columns_0_with_optimize_projections[new_events_schema]
- "SELECT e.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS e LEFT JOIN (SELECT person.id AS id FROM person WHERE equals(person.team_id, 99999) GROUP BY person.id HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_2)s), person.version), plus(now64(6, %(hogql_val_3)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, e.person_id) LIMIT 50000"
+ "SELECT e.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), '{}'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS e LEFT JOIN (SELECT person.id AS id FROM person WHERE equals(person.team_id, 99999) GROUP BY person.id HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_2)s), person.version), plus(now64(6, %(hogql_val_3)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, e.person_id) LIMIT 50000"
# ---
# name: TestPrinter.test_projection_pushdown_preserves_join_columns_1_without_optimize_projections[new_events_schema]
- 'SELECT e.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, JSONStripEmptyStringsAndNulls(concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\')) AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS e LEFT JOIN (SELECT person.id AS id FROM person WHERE equals(person.team_id, 99999) GROUP BY person.id HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_4)s), person.version), plus(now64(6, %(hogql_val_5)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, e.person_id) LIMIT 50000'
+ 'SELECT e.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and not (kv.2 = \'""\' and kv.1 in (\'$browser\', \'$browser_language\', \'$browser_version\', \'$config_defaults\', \'$device_type\', \'$geoip_city_name\', \'$geoip_continent_code\', \'$geoip_continent_name\', \'$geoip_country_code\', \'$geoip_country_name\', \'$geoip_subdivision_1_name\', \'$geoip_time_zone\', \'$group_0\', \'$group_1\', \'$group_2\', \'$group_3\', \'$group_4\', \'$lib\', \'$lib_version\', \'$os\', \'$os_version\', \'$session_id\', \'$timezone\', \'$window_id\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\') AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), \'{}\'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), \'{}\'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS e LEFT JOIN (SELECT person.id AS id FROM person WHERE equals(person.team_id, 99999) GROUP BY person.id HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_4)s), person.version), plus(now64(6, %(hogql_val_5)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, e.person_id) LIMIT 50000'
# ---
# name: TestPrinter.test_projection_pushdown_preserves_where_columns_0_with_optimize_projections[new_events_schema]
- "SELECT sub.event AS event FROM (SELECT events.event AS event, events.distinct_id AS distinct_id, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub WHERE equals(sub.distinct_id, %(hogql_val_2)s) LIMIT 50000"
+ "SELECT sub.event AS event FROM (SELECT events.event AS event, events.distinct_id AS distinct_id, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), '{}'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub WHERE equals(sub.distinct_id, %(hogql_val_2)s) LIMIT 50000"
# ---
# name: TestPrinter.test_projection_pushdown_preserves_where_columns_1_without_optimize_projections[new_events_schema]
- 'SELECT sub.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, JSONStripEmptyStringsAndNulls(concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\')) AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub WHERE equals(sub.distinct_id, %(hogql_val_4)s) LIMIT 50000'
+ 'SELECT sub.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and not (kv.2 = \'""\' and kv.1 in (\'$browser\', \'$browser_language\', \'$browser_version\', \'$config_defaults\', \'$device_type\', \'$geoip_city_name\', \'$geoip_continent_code\', \'$geoip_continent_name\', \'$geoip_country_code\', \'$geoip_country_name\', \'$geoip_subdivision_1_name\', \'$geoip_time_zone\', \'$group_0\', \'$group_1\', \'$group_2\', \'$group_3\', \'$group_4\', \'$lib\', \'$lib_version\', \'$os\', \'$os_version\', \'$session_id\', \'$timezone\', \'$window_id\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\') AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), \'{}\'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), \'{}\'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub WHERE equals(sub.distinct_id, %(hogql_val_4)s) LIMIT 50000'
# ---
# name: TestPrinter.test_projection_pushdown_simple_asterisk_subquery_0_with_optimize_projections[new_events_schema]
- "SELECT sub.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000"
+ "SELECT sub.event AS event FROM (SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), '{}'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_1)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000"
# ---
# name: TestPrinter.test_projection_pushdown_simple_asterisk_subquery_1_without_optimize_projections[new_events_schema]
- 'SELECT sub.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, JSONStripEmptyStringsAndNulls(concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\')) AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), \'{}\'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000'
+ 'SELECT sub.event AS event FROM (SELECT events.uuid AS uuid, events.event AS event, concat(\'{\', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), arrayFilter(kv -> not (kv.2 = \'[]\' and kv.1 in (\'$exception_functions\', \'$exception_list\', \'$exception_sources\', \'$exception_types\', \'$exception_values\', \'$mcp_listed_tool_names\')) and not (kv.2 = \'""\' and kv.1 in (\'$browser\', \'$browser_language\', \'$browser_version\', \'$config_defaults\', \'$device_type\', \'$geoip_city_name\', \'$geoip_continent_code\', \'$geoip_continent_name\', \'$geoip_country_code\', \'$geoip_country_name\', \'$geoip_subdivision_1_name\', \'$geoip_time_zone\', \'$group_0\', \'$group_1\', \'$group_2\', \'$group_3\', \'$group_4\', \'$lib\', \'$lib_version\', \'$os\', \'$os_version\', \'$session_id\', \'$timezone\', \'$window_id\')) and kv.1 != \'$feature_flags\', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat(\'$feature/\', key)), \':\', if(value in (\'true\', \'false\'), value, toJSONString(multiIf(value = \'$false\', \'false\', value = \'$true\', \'true\', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat(\'"$active_feature_flags":\', toJSONString(mapKeys(mapFilter((key, value) -> value not in (\'\', \'false\'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), \':\', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), \',\'), \'}\') AS properties, toTimeZone(events.timestamp, %(hogql_val_1)s) AS timestamp, events.distinct_id AS distinct_id, events.elements_chain AS elements_chain, toTimeZone(events.created_at, %(hogql_val_2)s) AS created_at, events.properties.`$session_id` AS `$session_id`, events.properties.`$window_id` AS `$window_id`, events.person_mode AS person_mode, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id, events.properties.`$group_0` AS `$group_0`, events.properties.`$group_1` AS `$group_1`, events.properties.`$group_2` AS `$group_2`, events.properties.`$group_3` AS `$group_3`, events.properties.`$group_4` AS `$group_4`, events.elements_chain_href AS elements_chain_href, events.elements_chain_texts AS elements_chain_texts, events.elements_chain_ids AS elements_chain_ids, events.elements_chain_elements AS elements_chain_elements, accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), \'{}\'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), \'[]\'), \'{}\'), toString(events.properties.`$exception_issue_id`)))), %(hogql_val_3)s) AS event_issue_id, events__fingerprint_issue_state.issue_id AS issue_id, events__fingerprint_issue_state.issue_id AS issue_id_v2, events__fingerprint_issue_state.issue_name AS issue_name, events__fingerprint_issue_state.issue_description AS issue_description, events__fingerprint_issue_state.issue_status AS issue_status, events__fingerprint_issue_state.assigned_user_id AS issue_assigned_user_id, events__fingerprint_issue_state.assigned_role_id AS issue_assigned_role_id, events__fingerprint_issue_state.first_seen AS issue_first_seen FROM events_json AS events LEFT OUTER JOIN (SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_id), error_tracking_fingerprint_issue_state.version), 1)) AS issue_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_name), error_tracking_fingerprint_issue_state.version), 1)) AS issue_name, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_description), error_tracking_fingerprint_issue_state.version), 1)) AS issue_description, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.issue_status), error_tracking_fingerprint_issue_state.version), 1)) AS issue_status, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_user_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_user_id, toNullable(tupleElement(argMax(tuple(error_tracking_fingerprint_issue_state.assigned_role_id), error_tracking_fingerprint_issue_state.version), 1)) AS assigned_role_id, toNullable(tupleElement(argMax(tuple(toTimeZone(error_tracking_fingerprint_issue_state.first_seen, %(hogql_val_0)s)), error_tracking_fingerprint_issue_state.version), 1)) AS first_seen FROM error_tracking_fingerprint_issue_state WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999) GROUP BY fp_hash HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), \'{}\'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), \'\')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), \'[]\'), \'{}\'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash) LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, 99999) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE equals(events.team_id, 99999)) AS sub LIMIT 50000'
# ---
# name: TestPrinter.test_s3_tables_global_join_anonymous_tables_0_global_joins_with_optimize[new_events_schema]
"SELECT e.event AS event, ij.remote_id AS remote_id FROM events_json AS e GLOBAL INNER JOIN (SELECT remote_id AS remote_id FROM (SELECT p.id AS person_id, rt.id AS remote_id FROM (SELECT person.id AS id FROM person WHERE equals(person.team_id, 99999) GROUP BY person.id HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_0)s), person.version), plus(now64(6, %(hogql_val_1)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS p LEFT JOIN (SELECT test_table.id AS id FROM (SELECT * FROM s3(%(hogql_val_2_sensitive)s, %(hogql_val_4_sensitive)s, %(hogql_val_5_sensitive)s, 'Parquet', %(hogql_val_3)s) SETTINGS optimize_move_to_prewhere = 0) AS test_table) AS rt ON equals(rt.id, p.id))) AS ij ON equals(e.event, ij.remote_id) WHERE equals(e.team_id, 99999) LIMIT 50000"
@@ -3537,10 +3697,10 @@
"WITH some_remote_table AS (SELECT e.event AS event, t.id AS id FROM events_json AS e JOIN (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS t ON equals(toString(t.id), e.event) WHERE equals(e.team_id, 99999)) SELECT some_remote_table.event AS event FROM events_json AS events JOIN some_remote_table ON equals(events.event, toString(some_remote_table.id)) WHERE equals(events.team_id, 99999) LIMIT 50000"
# ---
# name: TestPrinter.test_s3_tables_global_join_with_in_and_property_type_0[new_events_schema]
- "SELECT events.event AS event FROM events_json AS events WHERE and(equals(events.team_id, 99999), globalIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), (SELECT test_table.id AS id FROM (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS test_table))) LIMIT 50000"
+ "SELECT events.event AS event FROM events_json AS events WHERE and(equals(events.team_id, 99999), globalIn(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), (SELECT test_table.id AS id FROM (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS test_table))) LIMIT 50000"
# ---
# name: TestPrinter.test_s3_tables_global_join_with_in_and_property_type_1[new_events_schema]
- "SELECT events.event AS event FROM events_json AS events WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), (SELECT test_table.id AS id FROM (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS test_table))) LIMIT 50000"
+ "SELECT events.event AS event FROM events_json AS events WHERE and(equals(events.team_id, 99999), in(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), (SELECT test_table.id AS id FROM (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS test_table))) LIMIT 50000"
# ---
# name: TestPrinter.test_s3_tables_global_join_with_multiple_joins_0[new_events_schema]
"SELECT e.event, s.event AS event, t.id AS id FROM events_json AS e GLOBAL JOIN (SELECT events.event AS event FROM events_json AS events WHERE equals(events.team_id, 99999)) AS s ON equals(e.event, s.event) GLOBAL LEFT JOIN (SELECT * FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_2_sensitive)s, %(hogql_val_3_sensitive)s, 'Parquet', %(hogql_val_1)s) SETTINGS optimize_move_to_prewhere = 0) AS t ON equals(e.event, toString(t.id)) WHERE equals(e.team_id, 99999) LIMIT 50000"
diff --git a/posthog/hogql/printer/test/test_events_json_document.py b/posthog/hogql/printer/test/test_events_json_document.py
new file mode 100644
index 000000000000..16efc84a3dc4
--- /dev/null
+++ b/posthog/hogql/printer/test/test_events_json_document.py
@@ -0,0 +1,63 @@
+import json
+
+import pytest
+
+from django.test import SimpleTestCase
+
+from parameterized import parameterized
+
+from posthog.hogql.printer.events_json_document import event_document_sql, person_document_sql
+
+from posthog.clickhouse.client import sync_execute
+from posthog.clickhouse.events_json import TEMPORARY_PROPERTIES_JSON_TYPE
+from posthog.models.event.sql import EVENTS_PROPERTIES_JSON_TYPE, PERSON_PROPERTIES_JSON_TYPE
+
+# A sent empty value under a dynamic key stays; the declared paths read '' or [] whether sent empty or absent,
+# so the document leaves those out.
+EVENT_DOCUMENTS = [
+ ({"$browser": "Chrome", "pathname": "/docs", "empty": "", "list": [], "nested": {"child": ""}}, None),
+ ({"$browser": "", "$exception_types": [], "custom_list": [], "note": ""}, {"custom_list": [], "note": ""}),
+ ({}, None),
+]
+PERSON_DOCUMENTS = [
+ ({"$initial_browser": "Chrome", "email": "[email protected]", "empty": "", "list": []}, None),
+ ({"$initial_browser": "", "$browser": "", "list": [], "note": ""}, {"list": [], "note": ""}),
+ ({}, None),
+]
+
+
[email protected]("clickhouse_database")
+class TestEventsJsonDocument(SimpleTestCase):
+ @parameterized.expand(
+ [
+ (
+ "event",
+ "properties",
+ event_document_sql("properties", "temporary_properties", None),
+ EVENTS_PROPERTIES_JSON_TYPE(),
+ EVENT_DOCUMENTS,
+ ),
+ (
+ "person",
+ "person_properties",
+ person_document_sql("person_properties"),
+ PERSON_PROPERTIES_JSON_TYPE(),
+ PERSON_DOCUMENTS,
+ ),
+ ]
+ )
+ def test_document_keeps_sent_empties_and_drops_declared_defaults(
+ self, _name: str, column: str, document_sql: str, json_type: str, cases: list[tuple[dict, dict | None]]
+ ) -> None:
+ rows = sync_execute(
+ f"SELECT {document_sql} FROM (SELECT CAST(arrayJoin(%(documents)s), %(json_type)s) AS {column}, "
+ f"CAST('{{}}', %(temporary_type)s) AS temporary_properties)",
+ {
+ "documents": [json.dumps(document) for document, _ in cases],
+ "json_type": json_type,
+ "temporary_type": TEMPORARY_PROPERTIES_JSON_TYPE,
+ },
+ )
+ assert [json.loads(row[0]) for row in rows] == [
+ expected if expected is not None else document for document, expected in cases
+ ]
diff --git a/posthog/hogql/printer/test/test_printer.py b/posthog/hogql/printer/test/test_printer.py
index 5e9a2aeecfdf..4e295f5688e0 100644
--- a/posthog/hogql/printer/test/test_printer.py
+++ b/posthog/hogql/printer/test/test_printer.py
@@ -158,7 +158,11 @@ class TestPrinter(BaseTest):
def _native_read_settings_suffix(self) -> str:
# The printer appends this to the global settings of every query that reads the native events table.
- return ", json_type_escape_dots_in_keys=1" if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA else ""
+ return (
+ ", json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0"
+ if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA
+ else ""
+ )
def _with_active_events_table(self, expected_sql: str) -> str:
if not settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
@@ -993,7 +997,7 @@ class TestPrinter(BaseTest):
def test_hogql_property_comparisons_use_active_storage_schema(self):
context = HogQLContext(team_id=self.team.pk)
expected_sql = (
- f"ifNull(equals({self._json_dynamic_property_expr('$browser')}, %(hogql_val_0)s), 0)"
+ "equals(events.properties.`$browser`, %(hogql_val_0)s)"
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA
else "ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, %(hogql_val_0)s), ''), 'null'), '^\"|\"$', ''), %(hogql_val_1)s), 0)"
)
@@ -1824,7 +1828,8 @@ class TestPrinter(BaseTest):
assert printed == (
f"SELECT {self._json_dynamic_property_expr('file_type')} AS ft "
f"FROM {self._events_table_ref()} "
- f"WHERE and(equals(events.team_id, {self.team.pk}), ifNull(equals(ft, %(hogql_val_0)s), 0)) "
+ f"WHERE and(equals(events.team_id, {self.team.pk}), "
+ "ifNull(equals(CAST(events.properties.file_type, 'Nullable(String)'), %(hogql_val_0)s), 0)) "
"LIMIT 50000"
)
assert "properties_group_custom" not in printed
@@ -3544,7 +3549,7 @@ class TestPrinter(BaseTest):
context=context,
)
property_expr = (
- self._json_dynamic_property_expr("is_boolean")
+ "events.properties.is_boolean"
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA
else "nullIf(nullIf(events.mat_is_boolean, ''), 'null')"
)
@@ -3583,7 +3588,7 @@ class TestPrinter(BaseTest):
mock_matcols_by_table.return_value = {"events": {("$ai_trace_id", "properties"): mat_col}}
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
- expected_expr = self._json_dynamic_property_expr("$ai_trace_id")
+ expected_expr = "CAST(events.properties.`$ai_trace_id`, 'Nullable(String)')"
else:
expected_expr = "events.`mat_$ai_trace_id`"
context = HogQLContext(team_id=self.team.pk, enable_select_queries=True)
@@ -3596,7 +3601,6 @@ class TestPrinter(BaseTest):
trace_param_key = next((k for k, v in context.values.items() if v == "trace123"), None)
self.assertIsNotNone(trace_param_key, "Expected 'trace123' to be recorded as a parameter value")
self.assertIn(f"equals({expected_expr}, %({trace_param_key})s)", sql)
- # Verify the equals for $ai_trace_id is NOT wrapped in ifNull (it appears directly in WHERE clause)
self.assertIn("WHERE and(equals(events.team_id,", sql)
# The read itself already maps an empty value to NULL, so no outer nullIf wraps it.
@@ -3605,7 +3609,9 @@ class TestPrinter(BaseTest):
self.assertEqual(
sql.strip(),
- expected_expr,
+ self._json_dynamic_property_expr("$ai_trace_id")
+ if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA
+ else expected_expr,
)
# IN operations - no ifNull wrapping
@@ -3641,7 +3647,7 @@ class TestPrinter(BaseTest):
value_param_key = next((k for k, v in context.values.items() if v == "value"), None)
assert value_param_key is not None, "Expected 'value' to be recorded as a parameter value"
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
- other_prop_expr = self._json_dynamic_property_expr("other_prop")
+ other_prop_expr = "CAST(events.properties.other_prop, 'Nullable(String)')"
self.assertIn(f"ifNull(equals({other_prop_expr}, %({value_param_key})s), 0)", sql)
self.assertNotIn("JSONExtractRaw(events.properties,", sql)
else:
@@ -3668,7 +3674,7 @@ class TestPrinter(BaseTest):
mock_matcols_by_table.return_value = {"events": {("$ai_session_id", "properties"): mat_col}}
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
- expected_expr = self._json_dynamic_property_expr("$ai_session_id")
+ expected_expr = "CAST(events.properties.`$ai_session_id`, 'Nullable(String)')"
else:
expected_expr = "events.`mat_$ai_session_id`"
context = HogQLContext(team_id=self.team.pk, enable_select_queries=True)
@@ -3678,7 +3684,6 @@ class TestPrinter(BaseTest):
session_param_key = next((k for k, v in context.values.items() if v == "session123"), None)
assert session_param_key is not None, "Expected 'session123' to be recorded as a parameter value"
self.assertIn(f"equals({expected_expr}, %({session_param_key})s)", sql)
- # Verify the equals for $ai_session_id is NOT wrapped in ifNull (it appears directly in WHERE clause)
self.assertIn("WHERE and(equals(events.team_id,", sql)
# The read itself already maps an empty value to NULL, so no outer nullIf wraps it.
@@ -3687,7 +3692,9 @@ class TestPrinter(BaseTest):
self.assertEqual(
sql.strip(),
- expected_expr,
+ self._json_dynamic_property_expr("$ai_session_id")
+ if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA
+ else expected_expr,
)
# IN operations - no ifNull wrapping
@@ -5645,15 +5652,18 @@ class TestNewEventsSchemaDefaults(BaseTest):
# Only a read of the native table needs ClickHouse to unescape stored dotted keys, and an older
# ClickHouse rejects the setting name, so it must not leak onto other queries.
self.assertNotIn("json_type_escape_dots_in_keys", printed_without_events)
+ self.assertNotIn("output_format_json_escape_forward_slashes", printed_without_events)
if use_new_events_schema:
self.assertIn("FROM events_json AS events", printed)
self.assertIn("events.properties.schema_test_property", printed)
self.assertNotIn("JSONExtractRaw", printed)
self.assertIn("json_type_escape_dots_in_keys=1", printed)
+ self.assertIn("output_format_json_escape_forward_slashes=0", printed)
else:
self.assertIn("FROM events ", printed)
self.assertIn("JSONExtractRaw(events.properties", printed)
self.assertNotIn("json_type_escape_dots_in_keys", printed)
+ self.assertNotIn("output_format_json_escape_forward_slashes", printed)
@snapshot_clickhouse_queries
@@ -6113,7 +6123,7 @@ class TestMaterializedColumnOptimization(ClickhouseTestMixin, APIBaseTest):
index_name = get_minmax_index_name(mat_col.name)
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
assert index_name not in eq_result.clickhouse
- assert self._json_dynamic_property_expr("test_prop") in eq_result.clickhouse
+ assert "CAST(events.properties.test_prop, 'Nullable(String)')" in eq_result.clickhouse
else:
assert get_index_from_explain(eq_result.clickhouse, index_name), (
f"Expected skip index {index_name} to be used"
@@ -6784,9 +6794,9 @@ class TestMaterializedColumnOptimization(ClickhouseTestMixin, APIBaseTest):
)
not_ilike_matches = {d for (d,) in not_ilike_result.results}
assert not_ilike_matches == not_ilike_expected, "not_ilike " + str(pattern)
- if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
+ if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA and mat_col:
assert not_ilike_result.clickhouse
- assert "mat_" not in not_ilike_result.clickhouse
+ assert mat_col.name not in not_ilike_result.clickhouse
@parameterized.expand(
[
@@ -6880,15 +6890,17 @@ class TestMaterializedColumnOptimization(ClickhouseTestMixin, APIBaseTest):
)
not_in_matches = {d for (d,) in not_in_result.results}
assert not_in_matches == not_in_expected, f"NOT IN {in_values}"
- if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
+ if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA and mat_col:
assert not_in_result.clickhouse
- assert "mat_" not in not_in_result.clickhouse
+ assert mat_col.name not in not_in_result.clickhouse
@parameterized.expand([("nullable", True), ("non_nullable", False)])
def test_lower_in_optimization_handles_null_and_sentinel_rows(self, _, is_nullable) -> None:
# The rewrite must stay correct for NULL/missing, empty-string, and literal-"null" property rows
event_name = "mat_col_opt_lower_in_test"
- with materialized("events", "test_prop", is_nullable=is_nullable, create_bloom_filter_lower_index=True):
+ with materialized(
+ "events", "test_prop", is_nullable=is_nullable, create_bloom_filter_lower_index=True
+ ) as mat_col:
events: list[tuple[str, dict]] = [
("mixed_case", {"test_prop": "[email protected]"}),
("lower_case", {"test_prop": "[email protected]"}),
@@ -6917,7 +6929,7 @@ class TestMaterializedColumnOptimization(ClickhouseTestMixin, APIBaseTest):
# Case-insensitive IN: matches the mixed-case and already-lowercase rows, nothing else.
in_matches, in_sql = run("IN")
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
- assert "mat_" not in in_sql
+ assert mat_col.name not in in_sql
else:
assert "has(" in in_sql, f"expected the bloom_filter_lower rewrite to fire: {in_sql}"
assert in_matches == {"mixed_case", "lower_case"}
diff --git a/posthog/hogql/test/__snapshots__/test_property_skip_indexes.new_events_schema.ambr b/posthog/hogql/test/__snapshots__/test_property_skip_indexes.new_events_schema.ambr
index 2c4fcec76c27..06092cb2a572 100644
--- a/posthog/hogql/test/__snapshots__/test_property_skip_indexes.new_events_schema.ambr
+++ b/posthog/hogql/test/__snapshots__/test_property_skip_indexes.new_events_schema.ambr
@@ -3,7 +3,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -11,7 +11,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '0'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '0'), 0))
LIMIT 50000
'''
# ---
@@ -19,7 +19,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '0'), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.test_prop, 'Nullable(String)'), '0'), 1))
LIMIT 50000
'''
# ---
@@ -43,7 +43,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%0%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%0%'), 0))
LIMIT 50000
'''
# ---
@@ -51,7 +51,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -59,7 +59,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -67,7 +67,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('0', '1')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('0', '1')))
LIMIT 50000
'''
# ---
@@ -75,7 +75,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(parseDateTime64BestEffortOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^lt_datetime_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^lt_datetime_prop)), if(isNull(nullIf(toString(events.properties.lt_datetime_prop), '')), NULL, if(and(in(ascii(toString(events.properties.lt_datetime_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.lt_datetime_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.lt_datetime_prop), '[]'), '{}'), toString(events.properties.lt_datetime_prop)))), 6, 'UTC'), toDateTime64('2024-01-15 10:30:00.000000', 6, 'UTC')), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(parseDateTime64BestEffortOrNull(if(notEquals(toJSONString(events.properties.^lt_datetime_prop), '{}'), toJSONString(events.properties.^lt_datetime_prop), if(isNull(nullIf(toString(events.properties.lt_datetime_prop), '')), NULL, if(and(in(ascii(toString(events.properties.lt_datetime_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.lt_datetime_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.lt_datetime_prop), '[]'), '{}'), toString(events.properties.lt_datetime_prop)))), 6, 'UTC'), toDateTime64('2024-01-15 10:30:00.000000', 6, 'UTC')), 0))
LIMIT 50000
'''
# ---
@@ -91,7 +91,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -99,7 +99,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -107,7 +107,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('5', '')))
+ WHERE and(equals(events.team_id, 99999), in(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('5', '')))
LIMIT 50000
'''
# ---
@@ -115,7 +115,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -123,7 +123,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -131,7 +131,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -139,7 +139,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -147,7 +147,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -155,7 +155,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
LIMIT 50000
'''
# ---
@@ -163,7 +163,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[0-9]'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[0-9]'), 0))
LIMIT 50000
'''
# ---
@@ -171,7 +171,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%value_that_is_long_enough%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%value_that_is_long_enough%'), 0))
LIMIT 50000
'''
# ---
@@ -179,7 +179,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%null%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%null%'), 0))
LIMIT 50000
'''
# ---
@@ -187,7 +187,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -195,7 +195,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -203,7 +203,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 1))
LIMIT 50000
'''
# ---
@@ -211,7 +211,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notIn(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')), 1))
LIMIT 50000
'''
# ---
@@ -235,7 +235,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
LIMIT 50000
'''
# ---
@@ -243,7 +243,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -251,7 +251,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -259,7 +259,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 1))
LIMIT 50000
'''
# ---
@@ -267,7 +267,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -275,7 +275,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -283,7 +283,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(lessOrEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(lessOrEquals(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -291,7 +291,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(greaterOrEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(greaterOrEquals(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -299,7 +299,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -307,7 +307,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
LIMIT 50000
'''
# ---
@@ -315,7 +315,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[0-9]'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '[0-9]'), 0))
LIMIT 50000
'''
# ---
@@ -323,7 +323,31 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), toDateTime64('2024-01-15 10:30:00.000000', 6, 'UTC')), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), toDateTime64('2024-01-15 10:30:00.000000', 6, 'UTC')), 0))
+ LIMIT 50000
+ '''
+# ---
+# name: TestEventPropertySkipIndexes.test_mat_col_nullable_minmax_lt_non_string_constant_against_string_column_errors_0_int[new_events_schema]
+ '''
+ SELECT count() AS `count()`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 5), 0))
+ LIMIT 50000
+ '''
+# ---
+# name: TestEventPropertySkipIndexes.test_mat_col_nullable_minmax_lt_non_string_constant_against_string_column_errors_1_float[new_events_schema]
+ '''
+ SELECT count() AS `count()`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 5.5), 0))
+ LIMIT 50000
+ '''
+# ---
+# name: TestEventPropertySkipIndexes.test_mat_col_nullable_minmax_lt_non_string_constant_against_string_column_errors_2_datetime[new_events_schema]
+ '''
+ SELECT count() AS `count()`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), toDateTime64('2024-01-15 10:30:00.000000', 6, 'UTC')), 0))
LIMIT 50000
'''
# ---
@@ -355,7 +379,7 @@
'''
SELECT events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '500'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '500'), 0))
ORDER BY events.distinct_id ASC
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -369,14 +393,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventPropertySkipIndexes.test_mat_col_nullable_minmax_lt_string_constant_flavors_0_string_pure_alpha[new_events_schema]
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'apple'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), 'apple'), 0))
LIMIT 50000
'''
# ---
@@ -384,7 +409,15 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15'), 0))
+ LIMIT 50000
+ '''
+# ---
+# name: TestEventPropertySkipIndexes.test_mat_col_nullable_minmax_lt_string_constant_flavors_1_string_numeric_looking[new_events_schema]
+ '''
+ SELECT count() AS `count()`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
LIMIT 50000
'''
# ---
@@ -392,7 +425,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15'), 0))
LIMIT 50000
'''
# ---
@@ -400,7 +433,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15T10:30:00Z'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15T10:30:00Z'), 0))
LIMIT 50000
'''
# ---
@@ -408,7 +441,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15T10:30:00Z'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '2024-01-15T10:30:00Z'), 0))
LIMIT 50000
'''
# ---
@@ -416,7 +449,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%value_that_is_long_enough%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%value_that_is_long_enough%'), 0))
LIMIT 50000
'''
# ---
@@ -424,7 +457,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%abc%'), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%abc%'), 1))
LIMIT 50000
'''
# ---
@@ -432,7 +465,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -448,7 +481,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), 'value_that_is_long_enough'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), 'value_that_is_long_enough'), 0))
LIMIT 50000
'''
# ---
@@ -456,7 +489,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -464,7 +497,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -472,7 +505,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNull(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -480,7 +513,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -496,7 +529,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^test_prop)), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^test_prop), '{}'), toJSONString(events.properties.^test_prop), if(isNull(nullIf(toString(events.properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.test_prop), '[]'), '{}'), toString(events.properties.test_prop))))), '%5%'), 0))
LIMIT 50000
'''
# ---
@@ -504,7 +537,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(parseDateTime64BestEffortOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^typed_datetime_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^typed_datetime_prop)), if(isNull(nullIf(toString(events.properties.typed_datetime_prop), '')), NULL, if(and(in(ascii(toString(events.properties.typed_datetime_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.typed_datetime_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.typed_datetime_prop), '[]'), '{}'), toString(events.properties.typed_datetime_prop)))), 6, 'UTC'), '2024-01-05 00:00:00'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(parseDateTime64BestEffortOrNull(if(notEquals(toJSONString(events.properties.^typed_datetime_prop), '{}'), toJSONString(events.properties.^typed_datetime_prop), if(isNull(nullIf(toString(events.properties.typed_datetime_prop), '')), NULL, if(and(in(ascii(toString(events.properties.typed_datetime_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.typed_datetime_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.typed_datetime_prop), '[]'), '{}'), toString(events.properties.typed_datetime_prop)))), 6, 'UTC'), '2024-01-05 00:00:00'), 0))
LIMIT 50000
'''
# ---
@@ -520,7 +553,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.person_properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -528,7 +561,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.person_properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -536,7 +569,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(notIn(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), tuple('2', '5')), 1))
+ WHERE and(equals(events.team_id, 99999), ifNull(notIn(CAST(events.person_properties.test_prop, 'Nullable(String)'), tuple('2', '5')), 1))
LIMIT 50000
'''
# ---
@@ -552,7 +585,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.person_properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -560,7 +593,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(less(if(notEquals(toJSONString(events.person_properties.^test_prop), '{}'), toJSONString(events.person_properties.^test_prop), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -568,7 +601,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), 'mango'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(greater(if(notEquals(toJSONString(events.person_properties.^test_prop), '{}'), toJSONString(events.person_properties.^test_prop), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), 'mango'), 0))
LIMIT 50000
'''
# ---
@@ -576,7 +609,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.person_properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
@@ -584,7 +617,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))), '%5%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^test_prop), '{}'), toJSONString(events.person_properties.^test_prop), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))), '%5%'), 0))
LIMIT 50000
'''
# ---
@@ -592,7 +625,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))), '%value_that_is_long_enough%'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^test_prop), '{}'), toJSONString(events.person_properties.^test_prop), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))), '%value_that_is_long_enough%'), 0))
LIMIT 50000
'''
# ---
@@ -600,7 +633,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.person_properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -608,7 +641,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), '5'), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.person_properties.test_prop, 'Nullable(String)'), '5'), 0))
LIMIT 50000
'''
# ---
@@ -616,7 +649,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))))
+ WHERE and(equals(events.team_id, 99999), isNotNull(if(notEquals(toJSONString(events.person_properties.^test_prop), '{}'), toJSONString(events.person_properties.^test_prop), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop))))))
LIMIT 50000
'''
# ---
@@ -624,7 +657,7 @@
'''
SELECT count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^test_prop)), if(isNull(nullIf(toString(events.person_properties.test_prop), '')), NULL, if(and(in(ascii(toString(events.person_properties.test_prop)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.test_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.test_prop), '[]'), '{}'), toString(events.person_properties.test_prop)))), tuple('2', '5')))
+ WHERE and(equals(events.team_id, 99999), in(CAST(events.person_properties.test_prop, 'Nullable(String)'), tuple('2', '5')))
LIMIT 50000
'''
# ---
diff --git a/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr b/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
index c4ac16e40719..f8a1fc94b8ce 100644
--- a/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
+++ b/posthog/hogql/test/__snapshots__/test_query.new_events_schema.ambr
@@ -9,13 +9,13 @@
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0)
- SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), and(equals(events.event, %(hogql_val_12)s), isNotNull(events__fingerprint_issue_state.issue_id), or(and(greater(toTimeZone(events.timestamp, %(hogql_val_13)s), parseDateTime64BestEffort(%(hogql_val_14)s, 6, %(hogql_val_15)s)), less(toTimeZone(events.timestamp, %(hogql_val_16)s), parseDateTime64BestEffort(%(hogql_val_17)s, 6, %(hogql_val_18)s))), and(greater(toTimeZone(events.timestamp, %(hogql_val_19)s), toDateTime(%(hogql_val_20)s, %(hogql_val_21)s)), less(toTimeZone(events.timestamp, %(hogql_val_22)s), toDateTime64(%(hogql_val_23)s, 6, %(hogql_val_24)s))))))
GROUP BY events__fingerprint_issue_state.issue_id
ORDER BY occurrences DESC
LIMIT 51
OFFSET 0
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT issue_id AS id, count(DISTINCT uuid) AS occurrences, count(DISTINCT nullIf($session_id, '')) AS sessions, count(DISTINCT distinct_id) AS users, max(timestamp) AS last_seen, min(timestamp) AS first_seen, reverse(arrayMap(x -> countEqual(groupArray(dateDiff('hour', toStartOfHour(timestamp), toStartOfHour(now()))), x), range(24))) AS volumeDay, reverse(arrayMap(x -> countEqual(groupArray(dateDiff('day', toStartOfDay(timestamp), toStartOfDay(now()))), x), range(31))) AS volumeMonth, reverse(arrayMap(x -> countEqual(groupArray(dateDiff('hour', toStartOfHour(timestamp), toStartOfHour(now()))), x), range(168))) AS customVolume
@@ -36,7 +36,7 @@
GROUP BY timestamp
HAVING greater(cnt, 10)
LIMIT 1
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT toDate(timestamp) AS timestamp, count() AS cnt
@@ -51,9 +51,9 @@
'''
-- ClickHouse
WITH latest_events AS (
- SELECT events.distinct_id AS distinct_id, argMax(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os_version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os_version`)), if(isNull(nullIf(toString(events.properties.`$os_version`), '')), NULL, if(and(in(ascii(toString(events.properties.`$os_version`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$os_version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$os_version`), '[]'), '{}'), toString(events.properties.`$os_version`)))), toTimeZone(events.timestamp, %(hogql_val_0)s)) AS latest_os_version
+ SELECT events.distinct_id AS distinct_id, argMax(if(notEquals(toJSONString(events.properties.^`$os_version`), '{}'), toJSONString(events.properties.^`$os_version`), if(isNull(nullIf(toString(events.properties.`$os_version`), '')), NULL, if(and(in(ascii(toString(events.properties.`$os_version`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$os_version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$os_version`), '[]'), '{}'), toString(events.properties.`$os_version`)))), toTimeZone(events.timestamp, %(hogql_val_0)s)) AS latest_os_version
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os`)), if(isNull(nullIf(toString(events.properties.`$os`), '')), NULL, if(and(in(ascii(toString(events.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$os`), '[]'), '{}'), toString(events.properties.`$os`)))), %(hogql_val_1)s), 0), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(30)), 6, %(hogql_val_3)s)))
+ WHERE and(equals(events.team_id, 99999), equals(events.properties.`$os`, %(hogql_val_1)s), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, %(hogql_val_2)s), toIntervalDay(30)), 6, %(hogql_val_3)s)))
GROUP BY events.distinct_id), major_versions AS (
SELECT latest_events.distinct_id AS distinct_id, latest_events.latest_os_version AS latest_os_version, splitByChar(%(hogql_val_4)s, ifNull(latest_events.latest_os_version, %(hogql_val_5)s))[1] AS major_version
FROM latest_events)
@@ -63,7 +63,7 @@
GROUP BY major_versions.major_version
ORDER BY major_versions.major_version ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
WITH latest_events AS (
@@ -95,9 +95,9 @@
-- ClickHouse
SELECT events.event AS event, events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.distinct_id, %(hogql_val_0)s), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), %(hogql_val_1)s), 0), lessOrEquals(events.timestamp, toDateTime64('2020-01-02 23:59:59.999999', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-01-01 00:00:00.000000', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), equals(events.distinct_id, %(hogql_val_0)s), and(ifNull(equals(CAST(events.properties.index, 'Nullable(String)'), %(hogql_val_1)s), 0), lessOrEquals(events.timestamp, toDateTime64('2020-01-02 23:59:59.999999', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-01-01 00:00:00.000000', 6, 'UTC'))))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, distinct_id
@@ -120,9 +120,9 @@
-- ClickHouse
SELECT events.event AS event, events.distinct_id AS distinct_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.distinct_id, %(hogql_val_0)s), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), %(hogql_val_1)s), 0))
+ WHERE and(equals(events.team_id, 99999), equals(events.distinct_id, %(hogql_val_0)s), ifNull(equals(CAST(events.properties.index, 'Nullable(String)'), %(hogql_val_1)s), 0))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, distinct_id
@@ -136,9 +136,9 @@
-- ClickHouse
SELECT e.event AS event, e.distinct_id AS distinct_id
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^random_uuid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^random_uuid)), if(isNull(nullIf(toString(e.properties.random_uuid), '')), NULL, if(and(in(ascii(toString(e.properties.random_uuid)), tuple(91, 123)), in(ascii(toJSONString(e.properties.random_uuid)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.random_uuid), '[]'), '{}'), toString(e.properties.random_uuid)))), %(hogql_val_0)s), 0))
+ WHERE and(equals(e.team_id, 99999), ifNull(equals(CAST(e.properties.random_uuid, 'Nullable(String)'), %(hogql_val_0)s), 0))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, distinct_id
@@ -158,7 +158,7 @@
FROM events_json AS events
WHERE equals(events.team_id, 99999)
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -172,11 +172,11 @@
# name: TestQuery.test_hogql_unnecessary_ifnull[new_events_schema]
'''
-- ClickHouse
- SELECT toDate(toTimeZone(events.timestamp, %(hogql_val_0)s)) AS timestamp, JSONExtractInt(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^field)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^field)), if(isNull(nullIf(toString(events.properties.field), '')), NULL, nullIf(nullIf(toJSONString(events.properties.field), '[]'), '{}'))), '')) AS json_int
+ SELECT toDate(toTimeZone(events.timestamp, %(hogql_val_0)s)) AS timestamp, JSONExtractInt(ifNull(if(notEquals(toJSONString(events.properties.^field), '{}'), toJSONString(events.properties.^field), if(isNull(nullIf(toString(events.properties.field), '')), NULL, nullIf(nullIf(toJSONString(events.properties.field), '[]'), '{}'))), '')) AS json_int
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), greaterOrEquals(timestamp, addDays(today(), -10)), equals(json_int, 17))
LIMIT 1
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT toDate(timestamp) AS timestamp, JSONExtractInt(properties, 'field') AS json_int
@@ -199,16 +199,16 @@
-- ClickHouse
SELECT e.event AS event, s.session_id AS session_id
FROM (
- SELECT e.event AS event, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$session_id`)), if(isNull(nullIf(toString(e.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$session_id`), '[]'), '{}'), toString(e.properties.`$session_id`)))) AS `properties__$session_id`
+ SELECT e.event AS event, if(notEquals(toJSONString(e.properties.^`$session_id`), '{}'), toJSONString(e.properties.^`$session_id`), if(isNull(nullIf(toString(e.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$session_id`), '[]'), '{}'), toString(e.properties.`$session_id`)))) AS `properties__$session_id`
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$session_id`)), if(isNull(nullIf(toString(e.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$session_id`), '[]'), '{}'), toString(e.properties.`$session_id`))))))
+ WHERE and(equals(e.team_id, 99999), isNotNull(if(notEquals(toJSONString(e.properties.^`$session_id`), '{}'), toJSONString(e.properties.^`$session_id`), if(isNull(nullIf(toString(e.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$session_id`), '[]'), '{}'), toString(e.properties.`$session_id`))))))
LIMIT 10) AS e LEFT JOIN (
SELECT session_replay_events.session_id AS session_id
FROM session_replay_events
WHERE equals(session_replay_events.team_id, 99999)
GROUP BY session_replay_events.session_id) AS s ON equals(s.session_id, e.`properties__$session_id`)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT e.event, s.session_id
@@ -231,16 +231,16 @@
-- ClickHouse
SELECT e.event AS event, s.session_id AS session_id
FROM (
- SELECT e.event AS event, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$$$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$$$session_id`)), if(isNull(nullIf(toString(e.properties.`$$$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$$$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$$$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$$$session_id`), '[]'), '{}'), toString(e.properties.`$$$session_id`)))) AS `properties__$$$session_id`
+ SELECT e.event AS event, if(notEquals(toJSONString(e.properties.^`$$$session_id`), '{}'), toJSONString(e.properties.^`$$$session_id`), if(isNull(nullIf(toString(e.properties.`$$$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$$$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$$$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$$$session_id`), '[]'), '{}'), toString(e.properties.`$$$session_id`)))) AS `properties__$$$session_id`
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$$$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$$$session_id`)), if(isNull(nullIf(toString(e.properties.`$$$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$$$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$$$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$$$session_id`), '[]'), '{}'), toString(e.properties.`$$$session_id`))))))
+ WHERE and(equals(e.team_id, 99999), isNotNull(if(notEquals(toJSONString(e.properties.^`$$$session_id`), '{}'), toJSONString(e.properties.^`$$$session_id`), if(isNull(nullIf(toString(e.properties.`$$$session_id`), '')), NULL, if(and(in(ascii(toString(e.properties.`$$$session_id`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$$$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$$$session_id`), '[]'), '{}'), toString(e.properties.`$$$session_id`))))))
LIMIT 10) AS e LEFT JOIN (
SELECT session_replay_events.session_id AS session_id
FROM session_replay_events
WHERE equals(session_replay_events.team_id, 99999)
GROUP BY session_replay_events.session_id) AS s ON equals(s.session_id, e.`properties__$$$session_id`)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT e.event, s.session_id
@@ -262,7 +262,7 @@
HAVING greater(sum(cohortpeople.sign), 0))))
GROUP BY events.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, count(*)
@@ -296,7 +296,7 @@
HAVING greater(sum(cohortpeople.sign), 0))))
GROUP BY events.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, count()
@@ -322,7 +322,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX)))))
GROUP BY events.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, count(*)
@@ -352,7 +352,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX)))))
GROUP BY events.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, count()
@@ -370,10 +370,10 @@
-- ClickHouse
SELECT count() AS `count()`, events.event AS event
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), if(isNull(nullIf(toString(events.properties.random_uuid), '')), NULL, if(and(in(ascii(toString(events.properties.random_uuid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_uuid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_uuid), '[]'), '{}'), toString(events.properties.random_uuid)))), %(hogql_val_0)s), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.random_uuid, 'Nullable(String)'), %(hogql_val_0)s), 0))
GROUP BY events.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT count(), event
@@ -396,7 +396,7 @@
SETTINGS optimize_aggregation_in_order=1) AS e__pdi ON equals(e.distinct_id, e__pdi.distinct_id)
WHERE equals(e.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, e.timestamp, e.pdi.distinct_id, pdi.person_id
@@ -426,7 +426,7 @@
SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), persons.id)
WHERE and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_3)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT events.event, persons.properties.email
@@ -448,7 +448,7 @@
SETTINGS optimize_aggregation_in_order=1) AS events__pdi ON equals(events.distinct_id, events__pdi.distinct_id)
WHERE equals(events.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, pdi.distinct_id, pdi.person_id
@@ -478,7 +478,7 @@
SETTINGS optimize_aggregation_in_order=1) AS e__pdi__person ON equals(e__pdi.e__pdi___person_id, e__pdi__person.id)
WHERE equals(e.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, e.timestamp, pdi.distinct_id, e.pdi.person.properties.sneaky_mail
@@ -505,7 +505,7 @@
SETTINGS optimize_aggregation_in_order=1) AS events__pdi__person ON equals(events__pdi.events__pdi___person_id, events__pdi__person.id)
WHERE equals(events.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, pdi.distinct_id, pdi.person.id
@@ -535,7 +535,7 @@
SETTINGS optimize_aggregation_in_order=1) AS events__pdi__person ON equals(events__pdi.events__pdi___person_id, events__pdi__person.id)
WHERE equals(events.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, pdi.distinct_id, pdi.person.properties.sneaky_mail
@@ -565,7 +565,7 @@
SETTINGS optimize_aggregation_in_order=1) AS e__pdi__person ON equals(e__pdi.e__pdi___person_id, e__pdi__person.id)
WHERE equals(e.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, e.timestamp, e.pdi.person.properties.sneaky_mail
@@ -596,7 +596,7 @@
WHERE equals(s.team_id, 99999)
GROUP BY s__pdi__person.properties___sneaky_mail
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT s.pdi.person.properties.sneaky_mail, count()
@@ -627,7 +627,7 @@
WHERE equals(e2.team_id, 99999)) AS e2 ON equals(if(not(empty(e1__override.distinct_id)), e1__override.person_id, e1.person_id), e2.person_id)
WHERE and(equals(e1.team_id, 99999), equals(e1.event, %(hogql_val_0)s), equals(e2.event, %(hogql_val_1)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT e1.event, e2.event
@@ -648,7 +648,7 @@
HAVING equals(argMax(person_distinct_id2.is_deleted, person_distinct_id2.version), 0)) AS pdi ON equals(e.distinct_id, pdi.distinct_id)
WHERE equals(e.team_id, 99999)
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, pdi.person_id
@@ -681,7 +681,7 @@
SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
WHERE equals(events.team_id, 99999)) AS events ON equals(persons.id, events.person_id)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT persons.id, events.event
@@ -711,7 +711,7 @@
SETTINGS optimize_aggregation_in_order=1) AS p ON equals(p.id, pdi.person_id)
WHERE equals(e.team_id, 99999)
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, pdi.distinct_id, p.id, p.properties.sneaky_mail
@@ -741,7 +741,7 @@
SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
WHERE equals(events.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, person.id, person.properties.sneaky_mail
@@ -752,11 +752,11 @@
# name: TestQuery.test_query_select_person_with_poe_without_joins[new_events_schema]
'''
-- ClickHouse
- SELECT events.event AS event, toTimeZone(events.timestamp, %(hogql_val_0)s) AS timestamp, events.person_id AS id, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^sneaky_mail)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^sneaky_mail)), if(isNull(nullIf(toString(events.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(events.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.sneaky_mail), '[]'), '{}'), toString(events.person_properties.sneaky_mail)))) AS sneaky_mail
+ SELECT events.event AS event, toTimeZone(events.timestamp, %(hogql_val_0)s) AS timestamp, events.person_id AS id, if(notEquals(toJSONString(events.person_properties.^sneaky_mail), '{}'), toJSONString(events.person_properties.^sneaky_mail), if(isNull(nullIf(toString(events.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(events.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.sneaky_mail), '[]'), '{}'), toString(events.person_properties.sneaky_mail)))) AS sneaky_mail
FROM events_json AS events
WHERE equals(events.team_id, 99999)
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event, timestamp, person.id, person.properties.sneaky_mail
@@ -767,12 +767,12 @@
# name: TestQuery.test_select_person_on_events[new_events_schema]
'''
-- ClickHouse
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(s.person_properties.^sneaky_mail)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(s.person_properties.^sneaky_mail)), if(isNull(nullIf(toString(s.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(s.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(s.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(s.person_properties.sneaky_mail), '[]'), '{}'), toString(s.person_properties.sneaky_mail)))) AS sneaky_mail, count() AS `count()`
+ SELECT if(notEquals(toJSONString(s.person_properties.^sneaky_mail), '{}'), toJSONString(s.person_properties.^sneaky_mail), if(isNull(nullIf(toString(s.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(s.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(s.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(s.person_properties.sneaky_mail), '[]'), '{}'), toString(s.person_properties.sneaky_mail)))) AS sneaky_mail, count() AS `count()`
FROM events_json AS s
WHERE equals(s.team_id, 99999)
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(s.person_properties.^sneaky_mail)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(s.person_properties.^sneaky_mail)), if(isNull(nullIf(toString(s.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(s.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(s.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(s.person_properties.sneaky_mail), '[]'), '{}'), toString(s.person_properties.sneaky_mail))))
+ GROUP BY if(notEquals(toJSONString(s.person_properties.^sneaky_mail), '{}'), toJSONString(s.person_properties.^sneaky_mail), if(isNull(nullIf(toString(s.person_properties.sneaky_mail), '')), NULL, if(and(in(ascii(toString(s.person_properties.sneaky_mail)), tuple(91, 123)), in(ascii(toJSONString(s.person_properties.sneaky_mail)), tuple(91, 123))), nullIf(nullIf(toJSONString(s.person_properties.sneaky_mail), '[]'), '{}'), toString(s.person_properties.sneaky_mail))))
LIMIT 10
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT poe.properties.sneaky_mail, count()
@@ -788,11 +788,11 @@
FROM (
SELECT count() AS cnt, events.event AS event
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), if(isNull(nullIf(toString(events.properties.random_uuid), '')), NULL, if(and(in(ascii(toString(events.properties.random_uuid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_uuid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_uuid), '[]'), '{}'), toString(events.properties.random_uuid)))), %(hogql_val_0)s), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.random_uuid, 'Nullable(String)'), %(hogql_val_0)s), 0))
GROUP BY events.event)
GROUP BY cnt, event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT cnt, event
@@ -812,11 +812,11 @@
FROM (
SELECT count(*) AS cnt, events.event AS event
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^random_uuid)), if(isNull(nullIf(toString(events.properties.random_uuid), '')), NULL, if(and(in(ascii(toString(events.properties.random_uuid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.random_uuid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.random_uuid), '[]'), '{}'), toString(events.properties.random_uuid)))), %(hogql_val_0)s), 0))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.random_uuid, 'Nullable(String)'), %(hogql_val_0)s), 0))
GROUP BY events.event) AS c
GROUP BY c.cnt, c.event
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT cnt, event
@@ -836,15 +836,15 @@
FROM (
SELECT col_a AS col_a, groupArray(tuple(col_b, col_c)) AS g
FROM (
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
+ SELECT if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
FROM events_json AS events
WHERE equals(events.team_id, 99999)
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event)
+ GROUP BY if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event)
GROUP BY col_a)
GROUP BY col_a
ORDER BY col_a ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT col_a, arrayZip((sumMap((g).1, (g).2) AS x).1, x.2) AS r
@@ -864,10 +864,10 @@
'''
-- ClickHouse
WITH PIVOT_TABLE_COL_ABC AS (
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
+ SELECT if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
FROM events_json AS events
WHERE equals(events.team_id, 99999)
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event), PIVOT_FUNCTION_1 AS (
+ GROUP BY if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event), PIVOT_FUNCTION_1 AS (
SELECT PIVOT_TABLE_COL_ABC.col_a AS col_a, groupArray(tuple(PIVOT_TABLE_COL_ABC.col_b, PIVOT_TABLE_COL_ABC.col_c)) AS g
FROM PIVOT_TABLE_COL_ABC
GROUP BY PIVOT_TABLE_COL_ABC.col_a), PIVOT_FUNCTION_2 AS (
@@ -878,7 +878,7 @@
FROM PIVOT_FUNCTION_2
ORDER BY PIVOT_FUNCTION_2.col_a ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
WITH PIVOT_TABLE_COL_ABC AS (
@@ -901,10 +901,10 @@
'''
-- ClickHouse
WITH PIVOT_TABLE_COL_ABC AS (
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
+ SELECT if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))) AS col_a, events.event AS col_b, count() AS col_c
FROM events_json AS events
WHERE equals(events.team_id, 99999)
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^index)), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event), PIVOT_FUNCTION_1 AS (
+ GROUP BY if(notEquals(toJSONString(events.properties.^index), '{}'), toJSONString(events.properties.^index), if(isNull(nullIf(toString(events.properties.index), '')), NULL, if(and(in(ascii(toString(events.properties.index)), tuple(91, 123)), in(ascii(toJSONString(events.properties.index)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.index), '[]'), '{}'), toString(events.properties.index)))), events.event), PIVOT_FUNCTION_1 AS (
SELECT PIVOT_TABLE_COL_ABC.col_a AS col_a, groupArray(tuple(PIVOT_TABLE_COL_ABC.col_b, PIVOT_TABLE_COL_ABC.col_c)) AS g
FROM PIVOT_TABLE_COL_ABC
GROUP BY PIVOT_TABLE_COL_ABC.col_a), PIVOT_FUNCTION_2 AS (
@@ -917,7 +917,7 @@
FROM final
ORDER BY final.col_a ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
WITH PIVOT_TABLE_COL_ABC AS (
diff --git a/posthog/hogql/test/test_property.py b/posthog/hogql/test/test_property.py
index f0efd2491889..e6d27116e9ba 100644
--- a/posthog/hogql/test/test_property.py
+++ b/posthog/hogql/test/test_property.py
@@ -503,7 +503,7 @@ class TestProperty(BaseTest):
sql, _ = prepare_and_print_ast(query, context=context, dialect="clickhouse")
self.assertIn("getSubcolumn(events.properties, %(hogql_val_", sql)
self.assertNotIn("events.properties.a", sql)
- self.assertEqual(set(context.values.values()) - {"x"}, {"a%2Eb", "^`a%2Eb`"})
+ self.assertEqual(set(context.values.values()) - {"x"}, {"a%2Eb"})
def test_property_string_expr_reads_dotted_key_as_one_flat_path_on_native_table(self):
# Raw-SQL readers must bind the escaped path name like the printer does, and stay safe for callers that
diff --git a/posthog/hogql/test/utils.py b/posthog/hogql/test/utils.py
index 97cfbc6dc3f2..672cfbf4606a 100644
--- a/posthog/hogql/test/utils.py
+++ b/posthog/hogql/test/utils.py
@@ -174,8 +174,8 @@ def json_dynamic_read_sql_from_parts(
next `%(hogql_val_N)s` placeholder each time. The shape mirrors `_json_subcolumn_value_expr`: a non-empty
sub-object wins, an empty scalar reads as NULL, containers render as JSON.
"""
- sub_object_read = f"JSONStripEmptyStringsAndNulls(toJSONString({sub_object()}))" if with_sub_object else ""
- sub_object_again = f"JSONStripEmptyStringsAndNulls(toJSONString({sub_object()}))" if with_sub_object else ""
+ sub_object_read = f"toJSONString({sub_object()})" if with_sub_object else ""
+ sub_object_again = f"toJSONString({sub_object()})" if with_sub_object else ""
empty_check = f"isNull(nullIf(toString({field()}), ''))"
if as_json:
typed = f"nullIf(nullIf(toJSONString({field()}), '[]'), '{{}}')"
diff --git a/posthog/hogql/transforms/clickhouse_property_resolution.py b/posthog/hogql/transforms/clickhouse_property_resolution.py
index 63c72ada4882..7eaf7ab71389 100644
--- a/posthog/hogql/transforms/clickhouse_property_resolution.py
+++ b/posthog/hogql/transforms/clickhouse_property_resolution.py
@@ -61,6 +61,7 @@ from posthog.clickhouse.events_json import (
DISTRIBUTED_EVENTS_JSON_TABLE,
EVENTS_PROPERTIES_JSON_SUBCOLUMNS,
PERMANENT_SDK_DEBUG_PROPERTIES,
+ PERSON_PROPERTIES_JSON_SUBCOLUMNS,
TEMPORARY_EVENT_PROPERTY_ROOT_PREFIX,
TEMPORARY_EVENT_PROPERTY_ROOTS,
TEMPORARY_PROPERTIES_COLUMN,
@@ -1346,6 +1347,10 @@ class ClickHousePropertyResolver(CloningVisitor):
type=node.type,
)
+ boolean_conversion = self._rewrite_boolean_property_conversion(node)
+ if boolean_conversion is not None:
+ return boolean_conversion
+
json_string_on_events_json = self._rewrite_to_json_string_on_events_json_subcolumn(node)
if json_string_on_events_json is not None:
return json_string_on_events_json
@@ -1401,6 +1406,33 @@ class ClickHousePropertyResolver(CloningVisitor):
return super().visit_call(node)
+ def _rewrite_boolean_property_conversion(self, node: ast.Call) -> ast.Expr | None:
+ match node:
+ case ast.Call(
+ name="transform",
+ args=[
+ ast.Call(name="toString", args=[operand]) as string_read,
+ ast.Constant(value=["true", "false"]),
+ ast.Constant(value=[1, 0]),
+ ast.Constant(value=None),
+ ],
+ ):
+ access = self._lowered_property_operand(operand)
+ if access is None or not all(isinstance(key, str) for key in access.keys):
+ return None
+ field_type = _blob_field_type_of(access)
+ assert field_type is not None
+ keys = cast(list[str], access.keys)
+ if self._is_virtual_feature_flag_property(field_type, keys[0]):
+ return None
+ source = resolve_materialized_property_source(field_type, ".".join(keys), self.context)
+ if source is None or source.kind != "json_subcolumn":
+ return None
+ # Object and array text cannot match either Boolean spelling.
+ value = _json_subcolumn_access(field_type, keys, source=source, is_nullable=True)
+ return replace(node, args=[replace(string_read, args=[value]), *node.args[1:]])
+ return None
+
def _rewrite_feature_flag_json_call(self, node: ast.Call) -> ast.Expr | None:
"""A JSON function over a virtual flag key, rewritten on native events to parse the flag read.
@@ -1860,6 +1892,7 @@ class ClickHousePropertyResolver(CloningVisitor):
or self._optimize_materialized_array_compare(node)
or self._optimize_materialized_array_ilike(node)
or self._optimize_materialized_array_multisearch(node)
+ or self._optimize_native_json_string_compare(node)
or self._optimize_materialized_equals(node)
or self._optimize_materialized_range(node)
or self._optimize_materialized_ilike(node)
@@ -1983,9 +2016,9 @@ class ClickHousePropertyResolver(CloningVisitor):
) -> _OptimizableProperty | None:
"""A single-key string property backed by an individually materialized column, or None.
- Unwraps a `toString(properties.x)` wrapper, requires a single key, skips properties whose resolved type isn't a
- string unless a dynamic JSON value is being compared as a string, and requires a materialized column (not a
- property group). The plain and `toString(...)` forms both resolve to the same lowered property.
+ Unwraps a `toString(properties.x)` wrapper, requires a single key with string semantics, and requires a
+ materialized column or JSON subcolumn (not a property group). The plain and `toString(...)` forms both resolve
+ to the same lowered property.
"""
single = self._single_key_property(expr)
if single is None and isinstance(expr, ast.Call) and expr.name == "toString" and len(expr.args) == 1:
@@ -2000,14 +2033,9 @@ class ClickHousePropertyResolver(CloningVisitor):
return None
is_dynamic_json_string_comparison = allow_dynamic_json and _is_dynamic_json_source(source)
- if self.context.property_metadata is not None:
- prop_info = self.context.property_metadata.event_properties.get(property_name)
- if (
- prop_info is not None
- and prop_info.get("type") not in (None, "String")
- and not is_dynamic_json_string_comparison
- ):
- return None
+ property_type = ast.PropertyType(field_type=field_type, chain=[property_name])
+ if not isinstance(property_type.resolve_constant_type(self.context), ast.StringType):
+ return None
if not _is_string_column(source) and not is_dynamic_json_string_comparison:
return None
@@ -2369,6 +2397,51 @@ class ClickHousePropertyResolver(CloningVisitor):
)
return contains if node.op == ast.CompareOperationOp.Gt else _call("not", [contains])
+ def _optimize_native_json_string_compare(self, node: ast.CompareOperation) -> ast.Expr | None:
+ op_name = {
+ ast.CompareOperationOp.Eq: "equals",
+ ast.CompareOperationOp.NotEq: "notEquals",
+ ast.CompareOperationOp.In: "in",
+ ast.CompareOperationOp.NotIn: "notIn",
+ }.get(node.op)
+ if op_name is None:
+ return None
+ property_expr = node.left
+ if node.op in (ast.CompareOperationOp.Eq, ast.CompareOperationOp.NotEq):
+ constant = _string_pattern_constant(node.right)
+ if constant is None:
+ property_expr = node.right
+ constant = _string_pattern_constant(node.left)
+ values = [constant.value] if constant is not None else None
+ else:
+ values = self._extract_string_constants(node.right)
+ if not values or any(not value or value.startswith(("[", "{")) for value in values):
+ return None
+ if self._is_boolean_conversion(property_expr):
+ return None
+ prop = self._materialized_string_property(property_expr, allow_dynamic_json=True)
+ if prop is None or prop.source.kind != "json_subcolumn":
+ return None
+
+ declared_types = (
+ EVENTS_PROPERTIES_JSON_SUBCOLUMNS
+ if _is_events_properties(prop.field_type, self.context)
+ else PERSON_PROPERTIES_JSON_SUBCOLUMNS
+ )
+ declared_type = declared_types.get(prop.key) if prop.source.json_column is None else None
+ column = prop.bare_column()
+ if declared_type not in ("String", "LowCardinality(String)"):
+ # A bare Dynamic comparison converts the constant to each runtime type and can throw.
+ # The String cast matches the scalar read; containers cannot match these constants.
+ column = ast.TypeCast(expr=column, type_name="Nullable(String)", type=ast.StringType(nullable=True))
+ value: ast.Expr = (
+ ast.Tuple(exprs=[_const(value) for value in values])
+ if node.op in (ast.CompareOperationOp.In, ast.CompareOperationOp.NotIn)
+ else _const(values[0])
+ )
+ _record_property_usage(self.context, prop.source.kind)
+ return _call(op_name, [column, value])
+
def _optimize_materialized_equals(self, node: ast.CompareOperation) -> ast.Expr | None:
if node.op not in (ast.CompareOperationOp.Eq, ast.CompareOperationOp.NotEq):
return None
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_events_predicate_pushdown.new_events_schema.ambr b/posthog/hogql/transforms/test/__snapshots__/test_events_predicate_pushdown.new_events_schema.ambr
index 6db91ba08fab..042af6d4e7aa 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_events_predicate_pushdown.new_events_schema.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_events_predicate_pushdown.new_events_schema.ambr
@@ -106,7 +106,7 @@
SELECT events.event AS event, if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS id, events.person_properties AS properties, events.__pd_expr_0 AS created_at, events__session.`$session_duration` AS `$session_duration`
FROM (
- SELECT toTimeZone(events.person_created_at, %(hogql_val_0)s) AS __pd_expr_0, toUInt128(accurateCastOrNull(events.properties.`$session_id`, %(hogql_val_1)s)) AS __pd_expr_1, events.distinct_id AS distinct_id, events.event AS event, events.person_id AS person_id, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS person_properties
+ SELECT toTimeZone(events.person_created_at, %(hogql_val_0)s) AS __pd_expr_0, toUInt128(accurateCastOrNull(events.properties.`$session_id`, %(hogql_val_1)s)) AS __pd_expr_1, events.distinct_id AS distinct_id, events.event AS event, events.person_id AS person_id, concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""' and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS person_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_2)s, 6, %(hogql_val_3)s)))
LIMIT 50000) AS events LEFT JOIN (
@@ -273,7 +273,7 @@
SELECT events.event AS event, events.person_properties AS properties, events__session.`$session_duration` AS `$session_duration`
FROM (
- SELECT toUInt128(accurateCastOrNull(events.properties.`$session_id`, %(hogql_val_0)s)) AS __pd_expr_0, events.event AS event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties))), ','), '}')) AS person_properties
+ SELECT toUInt128(accurateCastOrNull(events.properties.`$session_id`, %(hogql_val_0)s)) AS __pd_expr_0, events.event AS event, concat('{', arrayStringConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '""' and kv.1 in ('$browser', '$browser_language', '$browser_version', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$initial_browser', '$initial_browser_language', '$initial_browser_version', '$initial_device_type', '$initial_geoip_city_name', '$initial_geoip_continent_code', '$initial_geoip_continent_name', '$initial_geoip_country_code', '$initial_geoip_country_name', '$initial_geoip_subdivision_1_name', '$initial_geoip_time_zone', '$initial_os', '$initial_os_version', '$os', '$os_version')), JSONExtractKeysAndValuesRaw(toJSONString(events.person_properties)))), ','), '}') AS person_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_1)s, 6, %(hogql_val_2)s)))
LIMIT 50000) AS events LEFT JOIN (
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_in_cohort.new_events_schema.ambr b/posthog/hogql/transforms/test/__snapshots__/test_in_cohort.new_events_schema.ambr
index 75f7138ae0b5..63697b7f2798 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_in_cohort.new_events_schema.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_in_cohort.new_events_schema.ambr
@@ -9,7 +9,7 @@
WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, XX), equals(cohortpeople.version, 0))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_0)s), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -31,7 +31,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), in(person_static_cohort.cohort_id, [1, 2, 3, 4, 5 /* ... */]))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -53,7 +53,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), in(person_static_cohort.cohort_id, [1, 2, 3, 4, 5 /* ... */]))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -75,7 +75,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX))) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -99,7 +99,7 @@
HAVING greater(sum(cohortpeople.sign), 0)) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1), equals(events.event, %(hogql_val_0)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -125,7 +125,7 @@
HAVING greater(sum(cohortpeople.sign), 0)) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1), equals(events.event, %(hogql_val_0)s), equals(in_cohort__XX.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -149,7 +149,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX))) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -171,7 +171,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX))) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -208,7 +208,7 @@
SETTINGS optimize_aggregation_in_order=1, join_algorithm='auto'))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_7)s), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -263,7 +263,7 @@
SETTINGS optimize_aggregation_in_order=1, join_algorithm='auto'))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_14)s), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -294,7 +294,7 @@
WHERE and(equals(cohortpeople.team_id, 99999), or(and(equals(cohortpeople.cohort_id, XX), equals(cohortpeople.version, 0)), and(equals(cohortpeople.cohort_id, XX), equals(cohortpeople.version, 0))))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_0)s), equals(__in_cohort.matched, 1))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -328,7 +328,7 @@
SETTINGS optimize_aggregation_in_order=1, join_algorithm='auto'))) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1), equals(events.event, %(hogql_val_6)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -363,7 +363,7 @@
HAVING greater(sum(cohortpeople.sign), 0)) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1), equals(events.event, %(hogql_val_0)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
@@ -387,7 +387,7 @@
WHERE and(equals(person_static_cohort.team_id, 99999), equals(person_static_cohort.cohort_id, XX))) AS in_cohort__XX ON equals(in_cohort__XX.person_id, events.person_id)
WHERE and(equals(events.team_id, 99999), equals(in_cohort__XX.matched, 1), equals(events.event, %(hogql_val_0)s))
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT event
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_property_types.new_events_schema.ambr b/posthog/hogql/transforms/test/__snapshots__/test_property_types.new_events_schema.ambr
index c9bdeb97ffa4..00391181eb95 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_property_types.new_events_schema.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_property_types.new_events_schema.ambr
@@ -49,7 +49,7 @@
# name: TestPropertyTypes.test_resolve_property_types_event[new_events_schema]
'''
- SELECT multiply(accurateCastOrNull(events.properties.`$screen_width`, 'Float64'), accurateCastOrNull(events.properties.`$screen_height`, 'Float64')), accurateCastOrNull(transform(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bool)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bool)), if(isNull(nullIf(toString(events.properties.bool), '')), NULL, if(and(in(ascii(toString(events.properties.bool)), tuple(91, 123)), in(ascii(toJSONString(events.properties.bool)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.bool), '[]'), '{}'), toString(events.properties.bool))))), %(hogql_val_0)s, %(hogql_val_1)s, NULL), %(hogql_val_2)s) AS bool
+ SELECT multiply(accurateCastOrNull(events.properties.`$screen_width`, 'Float64'), accurateCastOrNull(events.properties.`$screen_height`, 'Float64')), accurateCastOrNull(transform(toString(events.properties.bool), %(hogql_val_0)s, %(hogql_val_1)s, NULL), %(hogql_val_2)s) AS bool
FROM events_json AS events
WHERE equals(events.team_id, 420)
LIMIT 50000
@@ -79,7 +79,7 @@
# name: TestPropertyTypes.test_resolve_property_types_event_person_poe_on[new_events_schema]
'''
- SELECT parseDateTime64BestEffortOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^provided_timestamp)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^provided_timestamp)), if(isNull(nullIf(toString(events.person_properties.provided_timestamp), '')), NULL, if(and(in(ascii(toString(events.person_properties.provided_timestamp)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.provided_timestamp)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.provided_timestamp), '[]'), '{}'), toString(events.person_properties.provided_timestamp)))), 6, %(hogql_val_0)s) AS provided_timestamp
+ SELECT parseDateTime64BestEffortOrNull(if(notEquals(toJSONString(events.person_properties.^provided_timestamp), '{}'), toJSONString(events.person_properties.^provided_timestamp), if(isNull(nullIf(toString(events.person_properties.provided_timestamp), '')), NULL, if(and(in(ascii(toString(events.person_properties.provided_timestamp)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.provided_timestamp)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.provided_timestamp), '[]'), '{}'), toString(events.person_properties.provided_timestamp)))), 6, %(hogql_val_0)s) AS provided_timestamp
FROM events_json AS events
WHERE equals(events.team_id, 420)
LIMIT 50000
diff --git a/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.new_events_schema.ambr b/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.new_events_schema.ambr
index 02aee24607c3..1a53660a4390 100644
--- a/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.new_events_schema.ambr
+++ b/posthog/hogql/transforms/test/__snapshots__/test_state_aggregations.new_events_schema.ambr
@@ -27,17 +27,17 @@
SELECT tuple(uniqMerge(tupleElement(comprehensive_metrics, 1)), countMerge(tupleElement(comprehensive_metrics, 2)), sumMerge(tupleElement(comprehensive_metrics, 3)), avgMerge(tupleElement(comprehensive_metrics, 4))) AS comprehensive_metrics, source AS source
FROM (
- SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_0)s)), sumStateIf(1, equals(events.event, %(hogql_val_1)s)), avgStateIf(1, equals(events.event, %(hogql_val_2)s))) AS comprehensive_metrics, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))) AS source
+ SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_0)s)), sumStateIf(1, equals(events.event, %(hogql_val_1)s)), avgStateIf(1, equals(events.event, %(hogql_val_2)s))) AS comprehensive_metrics, if(notEquals(toJSONString(events.properties.^campaign_source), '{}'), toJSONString(events.properties.^campaign_source), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))) AS source
FROM events_json AS events
- WHERE and(equals(events.team_id, 420), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))), %(hogql_val_3)s), 0))
+ WHERE and(equals(events.team_id, 420), ifNull(equals(CAST(events.properties.campaign_source, 'Nullable(String)'), %(hogql_val_3)s), 0))
GROUP BY source)
GROUP BY source
LIMIT 50000 UNION ALL
SELECT tuple(uniqMerge(tupleElement(comprehensive_metrics, 1)), countMerge(tupleElement(comprehensive_metrics, 2)), sumMerge(tupleElement(comprehensive_metrics, 3)), avgMerge(tupleElement(comprehensive_metrics, 4))) AS comprehensive_metrics, source AS source
FROM (
- SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_4)s)), sumStateIf(1, equals(events.event, %(hogql_val_5)s)), avgStateIf(1, equals(events.event, %(hogql_val_6)s))) AS comprehensive_metrics, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))) AS source
+ SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_4)s)), sumStateIf(1, equals(events.event, %(hogql_val_5)s)), avgStateIf(1, equals(events.event, %(hogql_val_6)s))) AS comprehensive_metrics, if(notEquals(toJSONString(events.properties.^campaign_source), '{}'), toJSONString(events.properties.^campaign_source), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))) AS source
FROM events_json AS events
- WHERE and(equals(events.team_id, 420), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^campaign_source)), if(isNull(nullIf(toString(events.properties.campaign_source), '')), NULL, if(and(in(ascii(toString(events.properties.campaign_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.campaign_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.campaign_source), '[]'), '{}'), toString(events.properties.campaign_source)))), %(hogql_val_7)s), 0))
+ WHERE and(equals(events.team_id, 420), ifNull(equals(CAST(events.properties.campaign_source, 'Nullable(String)'), %(hogql_val_7)s), 0))
GROUP BY source)
GROUP BY source
LIMIT 50000
@@ -50,13 +50,13 @@
FROM (
SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_0)s)), countStateIf(equals(events.event, %(hogql_val_1)s))) AS funnel_metrics
FROM events_json AS events
- WHERE and(equals(events.team_id, 420), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^device_type)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^device_type)), if(isNull(nullIf(toString(events.properties.device_type), '')), NULL, if(and(in(ascii(toString(events.properties.device_type)), tuple(91, 123)), in(ascii(toJSONString(events.properties.device_type)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.device_type), '[]'), '{}'), toString(events.properties.device_type)))), %(hogql_val_2)s), 0)))
+ WHERE and(equals(events.team_id, 420), ifNull(equals(CAST(events.properties.device_type, 'Nullable(String)'), %(hogql_val_2)s), 0)))
LIMIT 50000 UNION ALL
SELECT tuple(uniqMerge(tupleElement(funnel_metrics, 1)), countMerge(tupleElement(funnel_metrics, 2)), countMerge(tupleElement(funnel_metrics, 3))) AS funnel_metrics
FROM (
SELECT tuple(uniqState(events.distinct_id), countStateIf(equals(events.event, %(hogql_val_3)s)), countStateIf(equals(events.event, %(hogql_val_4)s))) AS funnel_metrics
FROM events_json AS events
- WHERE and(equals(events.team_id, 420), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^device_type)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^device_type)), if(isNull(nullIf(toString(events.properties.device_type), '')), NULL, if(and(in(ascii(toString(events.properties.device_type)), tuple(91, 123)), in(ascii(toJSONString(events.properties.device_type)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.device_type), '[]'), '{}'), toString(events.properties.device_type)))), %(hogql_val_5)s), 0)))
+ WHERE and(equals(events.team_id, 420), ifNull(equals(CAST(events.properties.device_type, 'Nullable(String)'), %(hogql_val_5)s), 0)))
LIMIT 50000
'''
# ---
@@ -120,7 +120,7 @@
SELECT tuple(uniqMerge(tupleElement(user_metrics, 1)), countMerge(tupleElement(user_metrics, 2))) AS user_metrics, tuple(sumMerge(tupleElement(value_metrics, 1)), avgMerge(tupleElement(value_metrics, 2))) AS value_metrics, host AS host
FROM (
- SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
+ SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
FROM events_json AS events
WHERE and(equals(events.team_id, 420), less(events.timestamp, toDateTime64(%(hogql_val_0)s, 6, %(hogql_val_1)s)))
GROUP BY host)
@@ -128,7 +128,7 @@
LIMIT 50000 UNION ALL
SELECT tuple(uniqMerge(tupleElement(user_metrics, 1)), countMerge(tupleElement(user_metrics, 2))) AS user_metrics, tuple(sumMerge(tupleElement(value_metrics, 1)), avgMerge(tupleElement(value_metrics, 2))) AS value_metrics, host AS host
FROM (
- SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
+ SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_2)s, 6, %(hogql_val_3)s)), less(events.timestamp, toDateTime64(%(hogql_val_4)s, 6, %(hogql_val_5)s)))
GROUP BY host)
@@ -136,7 +136,7 @@
LIMIT 50000 UNION ALL
SELECT tuple(uniqMerge(tupleElement(user_metrics, 1)), countMerge(tupleElement(user_metrics, 2))) AS user_metrics, tuple(sumMerge(tupleElement(value_metrics, 1)), avgMerge(tupleElement(value_metrics, 2))) AS value_metrics, host AS host
FROM (
- SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
+ SELECT tuple(uniqState(events.distinct_id), countState()) AS user_metrics, tuple(sumState(1), avgState(1)) AS value_metrics, if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_6)s, 6, %(hogql_val_7)s)))
GROUP BY host)
@@ -219,7 +219,7 @@
SELECT uniqMerge(unique_users) AS unique_users, countMerge(total_events) AS total_events, host AS host
FROM (
- SELECT uniqState(events.distinct_id) AS unique_users, countState() AS total_events, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
+ SELECT uniqState(events.distinct_id) AS unique_users, countState() AS total_events, if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_0)s, 6, %(hogql_val_1)s)))
GROUP BY host
@@ -277,7 +277,7 @@
SELECT host AS host, uniqMerge(unique_users) AS unique_users, sumMerge(click_count) AS click_count, avgMerge(avg_duration) AS avg_duration
FROM (
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host, uniqState(events.distinct_id) AS unique_users, sumStateIf(1, equals(events.event, %(hogql_val_0)s)) AS click_count, avgState(accurateCastOrNull(events.properties.session_duration, 'Float64')) AS avg_duration
+ SELECT if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host, uniqState(events.distinct_id) AS unique_users, sumStateIf(1, equals(events.event, %(hogql_val_0)s)) AS click_count, avgState(accurateCastOrNull(events.properties.session_duration, 'Float64')) AS avg_duration
FROM events_json AS events
WHERE equals(events.team_id, 420)
GROUP BY host)
@@ -304,7 +304,7 @@
# name: TestStateTransforms.test_preserve_group_by[new_events_schema]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS pathname, uniqState(events.distinct_id) AS unique_users, countState() AS total_events
+ SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS pathname, uniqState(events.distinct_id) AS unique_users, countState() AS total_events
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_0)s, 6, %(hogql_val_1)s)))
GROUP BY pathname
@@ -314,7 +314,7 @@
# name: TestStateTransforms.test_preserve_query_without_aggregations[new_events_schema]
'''
- SELECT events.distinct_id AS distinct_id, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS pathname
+ SELECT events.distinct_id AS distinct_id, if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS pathname
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_0)s, 6, %(hogql_val_1)s)))
LIMIT 50000
@@ -465,7 +465,7 @@
SELECT tuple(uniqMerge(tupleElement(user_stats, 1)), countMerge(tupleElement(user_stats, 2))) AS user_stats, host AS host
FROM (
- SELECT tuple(uniqState(events.distinct_id), countState()) AS user_stats, if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
+ SELECT tuple(uniqState(events.distinct_id), countState()) AS user_stats, if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host
FROM events_json AS events
WHERE and(equals(events.team_id, 420), greaterOrEquals(events.timestamp, toDateTime64(%(hogql_val_0)s, 6, %(hogql_val_1)s)))
GROUP BY host)
@@ -523,7 +523,7 @@
SELECT host AS host, countMerge(total_count) AS total_count, countMerge(click_count) AS click_count
FROM (
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host, countState() AS total_count, countStateIf(equals(events.event, %(hogql_val_0)s)) AS click_count
+ SELECT if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))) AS host, countState() AS total_count, countStateIf(equals(events.event, %(hogql_val_0)s)) AS click_count
FROM events_json AS events
WHERE equals(events.team_id, 420)
GROUP BY host)
diff --git a/posthog/hogql/transforms/test/test_clickhouse_property_resolution.py b/posthog/hogql/transforms/test/test_clickhouse_property_resolution.py
index 86386280379b..711a1d1a237f 100644
--- a/posthog/hogql/transforms/test/test_clickhouse_property_resolution.py
+++ b/posthog/hogql/transforms/test/test_clickhouse_property_resolution.py
@@ -1,5 +1,7 @@
import json
+import pytest
+
from django.test import SimpleTestCase
from hypothesis import (
@@ -12,13 +14,25 @@ from parameterized import parameterized
from posthog.hogql import ast
from posthog.hogql.context import HogQLContext
-from posthog.hogql.database.schema.events import EventsTable
+from posthog.hogql.database.database import Database
+from posthog.hogql.database.schema.events import EventsPersonSubTable, EventsTable
+from posthog.hogql.parser import parse_select
+from posthog.hogql.printer import print_prepared_ast
+from posthog.hogql.printer.utils import prepare_ast_for_printing
+from posthog.hogql.property_access_types import RestrictedProperty
from posthog.hogql.property_metadata import PropertyMetadata
from posthog.hogql.transforms.clickhouse_property_resolution import (
MAX_MATERIALIZED_LIKE_PATTERN_LENGTH,
_is_json_verbatim,
clickhouse_property_resolution,
)
+from posthog.hogql.transforms.property_types import PropertySwapper
+
+from posthog.clickhouse.client import sync_execute
+from posthog.clickhouse.events_json import TEMPORARY_PROPERTIES_JSON_TYPE
+from posthog.models.event.sql import EVENTS_PROPERTIES_JSON_TYPE, PERSON_PROPERTIES_JSON_TYPE
+
+from products.event_definitions.backend.models.property_definition import PropertyDefinition
from ee.clickhouse.materialized_columns.columns import MaterializedColumn, MaterializedColumnDetails
@@ -82,3 +96,228 @@ class TestMaterializedLikePatternLimit(SimpleTestCase):
assert result.name == {"Like": "like", "NotLike": "notLike", "ILike": "ilike", "NotILike": "notILike"}[op]
assert isinstance(result.args[0], ast.Field)
assert result.args[0].chain[-1] == "mat_label"
+
+
[email protected]("clickhouse_database")
+class TestNativeJSONPropertyComparisons(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("event", "properties", "value", "properties.value", False),
+ ("person", "person_properties", "value", "poe.properties.value", False),
+ ("dotted", "properties", "value.child", "properties.`value.child`", False),
+ ("temporary", "temporary_properties", "$sdk_debug_flag", "properties.$sdk_debug_flag", False),
+ ("restricted", "properties", "value", "properties.value", True),
+ ]
+ )
+ def test_boolean_reads_preserve_mixed_values(
+ self, _name: str, column: str, key: str, property_expr: str, restricted: bool
+ ) -> None:
+ metadata = PropertyMetadata(
+ event_properties={key: {"type": "Boolean"}} if column != "person_properties" else {},
+ person_properties={key: {"type": "Boolean"}} if column == "person_properties" else {},
+ )
+ context = HogQLContext(
+ use_new_events_schema=True,
+ property_metadata=metadata,
+ database=Database(),
+ restricted_properties={RestrictedProperty(name=key, property_type=PropertyDefinition.Type.EVENT)}
+ if restricted
+ else set(),
+ apply_events_retention_floor=False,
+ )
+ context.property_swapper = PropertySwapper(
+ "UTC", metadata.event_properties, metadata.person_properties, {}, context, False
+ )
+ prepared = prepare_ast_for_printing(
+ parse_select(
+ f"SELECT tuple({property_expr}, {property_expr} = true, {property_expr} = false, "
+ f"{property_expr} IS NULL) FROM events"
+ ),
+ context,
+ "clickhouse",
+ )
+ assert isinstance(prepared, ast.SelectQuery)
+ printed = print_prepared_ast(prepared.select[0], context, "clickhouse")
+ assert "toJSONString" not in printed
+ values: list[object] = [
+ True,
+ "true",
+ False,
+ "false",
+ 1,
+ 0,
+ "1",
+ "TRUE",
+ "",
+ None,
+ {},
+ {"child": True},
+ [],
+ [True],
+ ]
+ documents = [{key: value} for value in values]
+ rows = sync_execute(
+ f"SELECT {printed} FROM (SELECT CAST(arrayJoin(%(documents)s), 'JSON') AS {column}) AS events",
+ {**context.values, "documents": [json.dumps(document) for document in [*documents, {}]]},
+ settings={"json_type_escape_dots_in_keys": 1},
+ )
+ expected = [None] * len(values) if restricted else [True, True, False, False, *([None] * (len(values) - 4))]
+ assert [row[0] for row in rows] == [
+ (value, int(value is True), int(value is False), int(value is None)) for value in [*expected, None]
+ ]
+
+ @parameterized.expand(
+ [
+ (field, property_type)
+ for field in ("properties", "person_properties")
+ for property_type in ("Numeric", "DateTime")
+ ]
+ )
+ def test_string_comparisons_preserve_property_types(self, field: str, property_type: str) -> None:
+ metadata = PropertyMetadata(
+ event_properties={"value": {"type": property_type if field == "properties" else "String"}},
+ person_properties={"value": {"type": property_type if field == "person_properties" else "String"}},
+ )
+ context = HogQLContext(
+ use_new_events_schema=True,
+ property_metadata=metadata,
+ database=Database(),
+ apply_events_retention_floor=False,
+ )
+ context.property_swapper = PropertySwapper(
+ "UTC", metadata.event_properties, metadata.person_properties, {}, context, False
+ )
+ prop = "properties.value" if field == "properties" else "poe.properties.value"
+ matching: list[object]
+ if property_type == "Numeric":
+ matching = [7, 7.0, "7", "7.0", "07"]
+ constant = "7.0"
+ different: object = 8
+ else:
+ matching = ["2024-04-06 07:08:09", "2024-04-06T07:08:09Z", "2024-04-06T09:08:09+02:00"]
+ constant = "2024-04-06 07:08:09"
+ different = "2024-04-07 07:08:09"
+ query = parse_select(
+ f"SELECT tuple({prop} = {{value}}, {{value}} = {prop}, {prop} != {{value}}, "
+ f"{prop} IN ({{value}}), {prop} NOT IN ({{value}}), NOT ({prop} IN ({{value}}))) FROM events",
+ placeholders={"value": ast.Constant(value=constant)},
+ )
+ prepared = prepare_ast_for_printing(query, context, "clickhouse")
+ assert isinstance(prepared, ast.SelectQuery)
+ printed = print_prepared_ast(prepared.select[0], context, "clickhouse")
+ rows = sync_execute(
+ f"SELECT {printed} FROM (SELECT CAST(arrayJoin(%(documents)s), 'JSON') AS {field}) AS events",
+ {**context.values, "documents": [json.dumps({"value": item}) for item in [*matching, different, None]]},
+ settings={"transform_null_in": 1},
+ )
+ assert [row[0] for row in rows] == [(1, 1, 0, 1, 0, 0)] * len(matching) + [(0, 0, 1, 0, 1, 1)] * 2
+
+ @parameterized.expand(
+ [
+ ("event", "properties", "value", "properties", "JSON", False),
+ ("person", "person_properties", "value", "person_properties", PERSON_PROPERTIES_JSON_TYPE(), False),
+ ("temporary", "properties", "$set", "temporary_properties", TEMPORARY_PROPERTIES_JSON_TYPE, False),
+ ("dotted", "properties", "value.name", "properties", "JSON", False),
+ ("declared_event", "properties", "$browser", "properties", EVENTS_PROPERTIES_JSON_TYPE(), True),
+ (
+ "declared_person",
+ "person_properties",
+ "$initial_browser",
+ "person_properties",
+ PERSON_PROPERTIES_JSON_TYPE(),
+ True,
+ ),
+ (
+ "person_event_key",
+ "person_properties",
+ "$session_id",
+ "person_properties",
+ PERSON_PROPERTIES_JSON_TYPE(),
+ False,
+ ),
+ ]
+ )
+ def test_string_comparisons_preserve_mixed_values(
+ self, _name: str, field: str, key: str, column: str, json_type: str, declared: bool
+ ) -> None:
+ context = HogQLContext(use_new_events_schema=True, property_metadata=PropertyMetadata())
+ table_type = ast.TableAliasType(alias="events", table_type=ast.TableType(table=EventsTable()))
+ field_type = ast.FieldType(name="properties", table_type=table_type)
+ if field == "person_properties":
+ field_type.table_type = ast.VirtualTableType(
+ table_type=table_type, field="poe", virtual_table=EventsPersonSubTable()
+ )
+ prop = ast.PropertyAccess(
+ expr=ast.Field(chain=[field], type=field_type), keys=[key], type=ast.StringType(nullable=True)
+ )
+ value = ast.Constant(value="5", type=ast.StringType(nullable=False))
+ values = ast.Tuple(exprs=[value, ast.Constant(value="true", type=ast.StringType(nullable=False))])
+ is_in = ast.CompareOperation(op=ast.CompareOperationOp.In, left=prop, right=values)
+ expression = ast.Tuple(
+ exprs=[
+ ast.CompareOperation(op=ast.CompareOperationOp.Eq, left=prop, right=value),
+ ast.CompareOperation(op=ast.CompareOperationOp.Eq, left=value, right=prop),
+ ast.CompareOperation(op=ast.CompareOperationOp.NotEq, left=prop, right=value),
+ is_in,
+ ast.CompareOperation(op=ast.CompareOperationOp.NotIn, left=prop, right=values),
+ ast.Not(expr=is_in),
+ ]
+ )
+ lowered = clickhouse_property_resolution(expression, context)
+ printed = print_prepared_ast(lowered, context, "clickhouse")
+ assert "toJSONString" not in printed
+ assert ("CAST(" in printed) is not declared
+ read = print_prepared_ast(clickhouse_property_resolution(prop, context), context, "clickhouse")
+ assert "JSONStripEmptyStringsAndNulls" not in read
+ fallback_values = ["", "[5]", '{"child":""}']
+ fallback = ast.Tuple(
+ exprs=[
+ ast.CompareOperation(op=ast.CompareOperationOp.Eq, left=prop, right=ast.Constant(value=value))
+ for value in fallback_values
+ ]
+ )
+ fallback_sql = print_prepared_ast(clickhouse_property_resolution(fallback, context), context, "clickhouse")
+
+ cases: list[tuple[dict[str, object], int, int]] = [
+ ({key: "5"}, 1, 1),
+ ({key: 5}, 1, 1),
+ ({key: True}, 0, 1),
+ ({key: "05"}, 0, 0),
+ ({key: "abc"}, 0, 0),
+ ({key: "null"}, 0, 0),
+ ({key: ""}, 0, 0),
+ ({key: None}, 0, 0),
+ ({}, 0, 0),
+ ]
+ if not declared:
+ cases.extend(
+ ({key: item}, 0, 0)
+ for item in (
+ [],
+ {},
+ [5],
+ {"child": ""},
+ {"escaped": '\u0001"\\\t', "url": "https://example.com/path", "number": 2**63},
+ "[5]",
+ 1.5,
+ )
+ )
+ rows = sync_execute(
+ f"SELECT {printed}, {read}, {fallback_sql} FROM (SELECT CAST(arrayJoin(%(documents)s), %(json_type)s) AS {column}) AS events",
+ {**context.values, "documents": [json.dumps(doc) for doc, _, _ in cases], "json_type": json_type},
+ settings={
+ "transform_null_in": 1,
+ "json_type_escape_dots_in_keys": 1,
+ "output_format_json_escape_forward_slashes": 0,
+ },
+ )
+ assert [row[0] for row in rows] == [(eq, eq, 1 - eq, member, 1 - member, 1 - member) for _, eq, member in cases]
+ for (_, read_value, fallback_result), (document, _, _) in zip(rows, cases):
+ assert fallback_result == tuple(int(read_value == value) for value in fallback_values)
+ sent = document.get(key)
+ if sent in (None, "", [], {}):
+ assert read_value is None
+ elif isinstance(sent, (list, dict)):
+ assert json.loads(read_value) == sent
+ else:
+ assert read_value == ("true" if sent is True else str(sent))
diff --git a/posthog/hogql/transforms/test/test_property_types.py b/posthog/hogql/transforms/test/test_property_types.py
index 5b686e58be34..64d673ca80e6 100644
--- a/posthog/hogql/transforms/test/test_property_types.py
+++ b/posthog/hogql/transforms/test/test_property_types.py
@@ -131,6 +131,45 @@ class _NewEventsSchemaArraySubcolumnsHelpers:
@override_settings(CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA=True)
class TestNewEventsSchemaArraySubcolumns(_NewEventsSchemaArraySubcolumnsHelpers, SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("dynamic", "properties.value = '5'", "CAST(events.properties.value, 'Nullable(String)')"),
+ ("declared", "properties.$browser IN ('Chrome', 'Firefox')", "in(events.properties.`$browser`, tuple("),
+ (
+ "person",
+ "poe.properties.$session_id = '5'",
+ "CAST(events.person_properties.`$session_id`, 'Nullable(String)')",
+ ),
+ ("to_string", "toString(properties.value) = '5'", "CAST(events.properties.value, 'Nullable(String)')"),
+ ]
+ )
+ def test_native_string_predicates_expose_subcolumns(self, _name: str, predicate: str, expected: str) -> None:
+ select = f"SELECT count() FROM events WHERE {predicate}"
+ native = self._print_select(select)
+ assert expected in native
+ assert "toJSONString" not in native
+
+ legacy = self._print_select(select, use_new_events_schema=False)
+ assert expected not in legacy
+
+ restricted = self._print_select(
+ select,
+ restricted_properties={
+ RestrictedProperty(name="value", property_type=PropertyDefinition.Type.EVENT),
+ RestrictedProperty(name="$browser", property_type=PropertyDefinition.Type.EVENT),
+ RestrictedProperty(name="$session_id", property_type=PropertyDefinition.Type.PERSON),
+ },
+ )
+ assert expected not in restricted
+ assert "events.properties" not in restricted
+ assert "events.person_properties" not in restricted
+
+ def test_native_string_predicate_inside_an_unaliased_column(self) -> None:
+ native = self._print_select("SELECT countIf(properties.value = '5') FROM events")
+ assert (
+ "countIf(ifNull(equals(CAST(events.properties.value, 'Nullable(String)'), %(hogql_val_0)s), 0))" in native
+ )
+
@parameterized.expand([("$active_feature_flags",), ("$exception_types",)])
def test_property_comparison_planner_does_not_depend_on_json_storage_type(self, property_name: str) -> None:
plan = self._plan_where_comparison(f"select count() from events where properties.{property_name} = 'TypeError'")
@@ -508,11 +547,29 @@ class TestNewEventsSchemaArraySubcolumnsClickhouse(_NewEventsSchemaArraySubcolum
@parameterized.expand(
[
- ("typed_array", "$exception_types"),
- ("dynamic_array", "custom_array"),
+ (name, property_name, value, escape_forward_slashes)
+ for name, property_name, value in [
+ ("typed_array", "$exception_types", ["a", '"b"', "https://example.com/path", r"a\/b", r"a\\/b"]),
+ ("dynamic_array", "custom_array", ["a", '"b"', "https://example.com/path", r"a\/b", r"a\\/b"]),
+ (
+ "object",
+ "custom_object",
+ {
+ "empty": "",
+ "escaped": '\u0001"\\\t',
+ "url": "https://example.com/path",
+ "number": 2**63,
+ "path": r"a\/b",
+ "double_backslash": r"a\\/b",
+ },
+ ),
+ ]
+ for escape_forward_slashes in (0, 1)
]
)
- def test_raw_property_helper_reads_only_one_json_subcolumn(self, _name: str, property_name: str) -> None:
+ def test_raw_property_helper_reads_only_one_json_subcolumn(
+ self, _name: str, property_name: str, value: list[str] | dict[str, str | int], escape_forward_slashes: int
+ ) -> None:
expression, _ = get_property_string_expr(
"events",
property_name,
@@ -530,10 +587,13 @@ class TestNewEventsSchemaArraySubcolumnsClickhouse(_NewEventsSchemaArraySubcolum
{
"property_key": property_name,
"json_type": EVENTS_PROPERTIES_JSON_TYPE(),
- "documents": [json.dumps({property_name: value}) for value in [["a", '"b"'], [], None]],
+ "documents": [json.dumps({property_name: item}) for item in [value, [], None]],
},
+ settings={"output_format_json_escape_forward_slashes": escape_forward_slashes},
)
- assert rows == [('["a","\\"b\\""]',), ("",), ("",)]
+ assert json.loads(rows[0][0]) == value
+ assert "https://example.com/path" in rows[0][0]
+ assert rows[1:] == [("",), ("",)]
@parameterized.expand(
[
@@ -1165,10 +1225,9 @@ class TestJSONExtractToMaterializedColumn(ClickhouseTestMixin, BaseTest):
assert "properties.`$browser`" in printed, printed
assert "properties.`$os`" in printed, printed
assert "mat_" not in printed, printed
- assert (
- printed.count("JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(")
- == 2
- ), printed
+ assert printed.count("JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^") == 2, (
+ printed
+ )
return
assert "mat_$browser" in printed, printed
@@ -1241,7 +1300,7 @@ class TestJSONExtractToMaterializedColumn(ClickhouseTestMixin, BaseTest):
printed = self._print_select("select JSONExtract(properties, '$browser', 'String') from events")
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
assert "events.properties.`$browser`" in printed, printed
- assert "JSONExtract(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(" in printed, printed
+ assert "JSONExtract(ifNull(if(notEquals(toJSONString(" in printed, printed
assert "mat_" not in printed, printed
return
@@ -1252,9 +1311,7 @@ class TestJSONExtractToMaterializedColumn(ClickhouseTestMixin, BaseTest):
printed = self._print_select("select JSONExtractInt(properties, '$browser') from events")
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
assert "events.properties.`$browser`" in printed, printed
- assert "JSONExtractInt(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(" in printed, (
- printed
- )
+ assert "JSONExtractInt(ifNull(if(notEquals(toJSONString(" in printed, printed
assert "mat_" not in printed, printed
return
@@ -1457,7 +1514,7 @@ class TestJSONExtractToMaterializedColumn(ClickhouseTestMixin, BaseTest):
if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA:
assert "events_json" in sql, sql
assert "events.properties.`$browser`" in sql, sql
- assert "JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(" in sql, sql
+ assert "JSONExtractString(ifNull(if(notEquals(toJSONString(" in sql, sql
assert "mat_$browser" not in sql, sql
else:
assert "JSONExtractString(events.properties" in sql, sql
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.new_events_schema.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.new_events_schema.ambr
index ab3456578f7b..614eae23579a 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_event_taxonomy_query_runner.new_events_schema.ambr
@@ -11,9 +11,11 @@
count() AS value_count,
max(timestamp) AS latest_seen
FROM
- (SELECT JSONExtractKeysAndValues(JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), 'String') AS kv,
+ (SELECT JSONExtractKeysAndValues(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), 'String') AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, 'event1'))
@@ -40,7 +42,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventTaxonomyQueryRunner.test_property_taxonomy_handles_numeric_property_values[new_events_schema]
@@ -55,10 +58,10 @@
count() AS value_count,
max(timestamp) AS latest_seen
FROM
- (SELECT [tuple('zero_duration_recording_count_in_period', JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^zero_duration_recording_count_in_period)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^zero_duration_recording_count_in_period)), if(isNull(nullIf(toString(events.properties.zero_duration_recording_count_in_period), '')), NULL, nullIf(nullIf(toJSONString(events.properties.zero_duration_recording_count_in_period), '[]'), '{}'))), '')))] AS kv,
+ (SELECT [tuple('zero_duration_recording_count_in_period', JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^zero_duration_recording_count_in_period), '{}'), toJSONString(events.properties.^zero_duration_recording_count_in_period), if(isNull(nullIf(toString(events.properties.zero_duration_recording_count_in_period), '')), NULL, nullIf(nullIf(toJSONString(events.properties.zero_duration_recording_count_in_period), '[]'), '{}'))), '')))] AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, 'organization usage report'), notEquals(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^zero_duration_recording_count_in_period)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^zero_duration_recording_count_in_period)), if(isNull(nullIf(toString(events.properties.zero_duration_recording_count_in_period), '')), NULL, nullIf(nullIf(toJSONString(events.properties.zero_duration_recording_count_in_period), '[]'), '{}'))), '')), ''))) ARRAY
+ WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, 'organization usage report'), notEquals(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^zero_duration_recording_count_in_period), '{}'), toJSONString(events.properties.^zero_duration_recording_count_in_period), if(isNull(nullIf(toString(events.properties.zero_duration_recording_count_in_period), '')), NULL, nullIf(nullIf(toJSONString(events.properties.zero_duration_recording_count_in_period), '[]'), '{}'))), '')), ''))) ARRAY
JOIN (kv).1 AS key,
(kv).2 AS value
WHERE and(isNotNull(value), ifNull(notEquals(value, ''), 1))
@@ -80,7 +83,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventTaxonomyQueryRunner.test_retrieves_action_properties[new_events_schema]
@@ -95,9 +99,11 @@
count() AS value_count,
max(timestamp) AS latest_seen
FROM
- (SELECT JSONExtractKeysAndValues(JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), 'String') AS kv,
+ (SELECT JSONExtractKeysAndValues(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), 'String') AS kv,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalDay(30)), 6, 'UTC')), equals(events.event, '$pageview'))
@@ -124,6 +130,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.new_events_schema.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.new_events_schema.ambr
index bd58a018657d..fbe2788b9850 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_suggested_questions_query_runner.new_events_schema.ambr
@@ -20,6 +20,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.new_events_schema.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.new_events_schema.ambr
index 1801650c38ba..6d20b274b584 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_team_taxonomy_query_runner.new_events_schema.ambr
@@ -20,6 +20,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_trace_query_runner.new_events_schema.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_trace_query_runner.new_events_schema.ambr
index 3cdaa5dbd2b0..32cda686e7c6 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_trace_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_trace_query_runner.new_events_schema.ambr
@@ -22,28 +22,30 @@
__ai_events_fallback.event AS event,
toTimeZone(__ai_events_fallback.timestamp, 'UTC') AS timestamp,
__ai_events_fallback.distinct_id AS distinct_id,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(__ai_events_fallback.properties.`$feature_flags`), mapValues(__ai_events_fallback.properties.`$feature_flags`)), if(empty(__ai_events_fallback.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), __ai_events_fallback.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.temporary_properties)))), ','), '}')) AS properties,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))) AS trace_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_session_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_session_id`)))) AS session_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_parent_id`)))) AS parent_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_span_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_span_name`)))) AS span_name,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_name`)))) AS trace_name,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(__ai_events_fallback.properties.`$feature_flags`), mapValues(__ai_events_fallback.properties.`$feature_flags`)), if(empty(__ai_events_fallback.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), __ai_events_fallback.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.temporary_properties)))), ','), '}') AS properties,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))) AS trace_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_session_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_session_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_session_id`)))) AS session_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_parent_id`)))) AS parent_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_span_name`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_span_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_span_name`)))) AS span_name,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_name`)))) AS trace_name,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_latency`, 'Float64'), 'Float64') AS latency,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_input_tokens`, 'Float64'), 'Float64') AS input_tokens,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_output_tokens`, 'Float64'), 'Float64') AS output_tokens,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64') AS input_cost_usd,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_output_cost_usd`, 'Float64'), 'Float64') AS output_cost_usd,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64') AS total_cost_usd,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input`), '[]'), '{}'))), '')) AS input,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output`), '[]'), '{}'))), '')) AS output,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_choices`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_choices`), '[]'), '{}'))), '')) AS output_choices,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input_state`), '[]'), '{}'))), '')) AS input_state,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_state`), '[]'), '{}'))), '')) AS output_state,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_tools`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_tools`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_tools`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_tools`), '[]'), '{}'))), '')) AS tools
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_input`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_input`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input`), '[]'), '{}'))), '')) AS input,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output`), '[]'), '{}'))), '')) AS output,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_choices`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_choices`), '[]'), '{}'))), '')) AS output_choices,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_input_state`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input_state`), '[]'), '{}'))), '')) AS input_state,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output_state`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_state`), '[]'), '{}'))), '')) AS output_state,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_tools`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_tools`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_tools`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_tools`), '[]'), '{}'))), '')) AS tools
FROM events_json AS __ai_events_fallback
- WHERE and(equals(__ai_events_fallback.team_id, 99999), in(__ai_events_fallback.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-12-08 00:10:00', 'UTC'))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))), 'trace1'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^foo)), if(isNull(nullIf(toString(__ai_events_fallback.properties.foo), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.foo), '[]'), '{}'), toString(__ai_events_fallback.properties.foo)))), 'barz'), 0)))
+ WHERE and(equals(__ai_events_fallback.team_id, 99999), in(__ai_events_fallback.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-12-08 00:10:00', 'UTC'))), equals(CAST(__ai_events_fallback.properties.`$ai_trace_id`, 'Nullable(String)'), 'trace1'), ifNull(equals(CAST(__ai_events_fallback.properties.foo, 'Nullable(String)'), 'barz'), 0)))
LIMIT 1 BY __ai_events_fallback.uuid) AS deduped
GROUP BY deduped.trace_id
LIMIT 1 SETTINGS readonly=2,
@@ -58,7 +60,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTraceQueryRunner.test_person_property_filters[new_events_schema]
@@ -84,28 +87,30 @@
__ai_events_fallback.event AS event,
toTimeZone(__ai_events_fallback.timestamp, 'UTC') AS timestamp,
__ai_events_fallback.distinct_id AS distinct_id,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(__ai_events_fallback.properties.`$feature_flags`), mapValues(__ai_events_fallback.properties.`$feature_flags`)), if(empty(__ai_events_fallback.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), __ai_events_fallback.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.temporary_properties)))), ','), '}')) AS properties,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))) AS trace_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_session_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_session_id`)))) AS session_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_parent_id`)))) AS parent_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_span_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_span_name`)))) AS span_name,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_name`)))) AS trace_name,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(__ai_events_fallback.properties.`$feature_flags`), mapValues(__ai_events_fallback.properties.`$feature_flags`)), if(empty(__ai_events_fallback.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), __ai_events_fallback.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(__ai_events_fallback.temporary_properties)))), ','), '}') AS properties,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))) AS trace_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_session_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_session_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_session_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_session_id`)))) AS session_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_parent_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_parent_id`)))) AS parent_id,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_span_name`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_span_name`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_span_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_span_name`)))) AS span_name,
+ if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_name`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_name`)))) AS trace_name,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_latency`, 'Float64'), 'Float64') AS latency,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_input_tokens`, 'Float64'), 'Float64') AS input_tokens,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_output_tokens`, 'Float64'), 'Float64') AS output_tokens,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64') AS input_cost_usd,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_output_cost_usd`, 'Float64'), 'Float64') AS output_cost_usd,
accurateCastOrNull(accurateCastOrNull(__ai_events_fallback.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64') AS total_cost_usd,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input`), '[]'), '{}'))), '')) AS input,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output`), '[]'), '{}'))), '')) AS output,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_choices`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_choices`), '[]'), '{}'))), '')) AS output_choices,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input_state`), '[]'), '{}'))), '')) AS input_state,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_state`), '[]'), '{}'))), '')) AS output_state,
- JSONExtractRaw(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_tools`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_tools`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_tools`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_tools`), '[]'), '{}'))), '')) AS tools
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_input`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_input`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input`), '[]'), '{}'))), '')) AS input,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output`), '[]'), '{}'))), '')) AS output,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output_choices`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_choices`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_choices`), '[]'), '{}'))), '')) AS output_choices,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_input_state`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_input_state`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_input_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_input_state`), '[]'), '{}'))), '')) AS input_state,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_output_state`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_output_state`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_output_state`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_output_state`), '[]'), '{}'))), '')) AS output_state,
+ JSONExtractRaw(ifNull(if(notEquals(toJSONString(__ai_events_fallback.properties.^`$ai_tools`), '{}'), toJSONString(__ai_events_fallback.properties.^`$ai_tools`), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_tools`), '')), NULL, nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_tools`), '[]'), '{}'))), '')) AS tools
FROM events_json AS __ai_events_fallback
- WHERE and(equals(__ai_events_fallback.team_id, 99999), in(__ai_events_fallback.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-12-08 00:10:00', 'UTC'))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(__ai_events_fallback.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.properties.`$ai_trace_id`), '[]'), '{}'), toString(__ai_events_fallback.properties.`$ai_trace_id`)))), 'trace1'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.person_properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(__ai_events_fallback.person_properties.^bar)), if(isNull(nullIf(toString(__ai_events_fallback.person_properties.bar), '')), NULL, if(and(in(ascii(toString(__ai_events_fallback.person_properties.bar)), tuple(91, 123)), in(ascii(toJSONString(__ai_events_fallback.person_properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(__ai_events_fallback.person_properties.bar), '[]'), '{}'), toString(__ai_events_fallback.person_properties.bar)))), 'foo'), 0)))
+ WHERE and(equals(__ai_events_fallback.team_id, 99999), in(__ai_events_fallback.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(__ai_events_fallback.timestamp, assumeNotNull(toDateTime('2024-12-08 00:10:00', 'UTC'))), equals(CAST(__ai_events_fallback.properties.`$ai_trace_id`, 'Nullable(String)'), 'trace1'), ifNull(equals(CAST(__ai_events_fallback.person_properties.bar, 'Nullable(String)'), 'foo'), 0)))
LIMIT 1 BY __ai_events_fallback.uuid) AS deduped
GROUP BY deduped.trace_id
LIMIT 1 SETTINGS readonly=2,
@@ -120,6 +125,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/ai/test/__snapshots__/test_traces_query_runner.new_events_schema.ambr b/posthog/hogql_queries/ai/test/__snapshots__/test_traces_query_runner.new_events_schema.ambr
index 8793db5abd23..8e33070f06c7 100644
--- a/posthog/hogql_queries/ai/test/__snapshots__/test_traces_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/ai/test/__snapshots__/test_traces_query_runner.new_events_schema.ambr
@@ -1,12 +1,12 @@
# serializer version: 1
# name: TestTracesQueryRunner.test_field_mapping[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -14,18 +14,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-13 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace1', 'trace2')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-13 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace1', 'trace2')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -40,7 +42,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_field_mapping[new_events_schema]
@@ -49,11 +52,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -70,17 +73,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -88,18 +92,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 02:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_project_1', 'trace_org_b', 'trace_org_a')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 02:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_project_1', 'trace_org_b', 'trace_org_a')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -114,7 +120,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.2]
@@ -123,11 +130,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'org:acme')))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'org:acme')))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -144,17 +151,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.3]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -162,18 +170,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 00:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_org_a')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 00:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_org_a')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -188,7 +198,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.4]
@@ -197,11 +208,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'org:widgets')))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'org:widgets')))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -218,17 +229,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.5]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -236,18 +248,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 00:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_org_b')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 00:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_org_b')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -262,7 +276,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.6]
@@ -271,11 +286,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_1`, 'project:alpha')))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_1`, 'project:alpha')))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -292,17 +307,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.7]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -310,18 +326,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 02:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_project_1')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 02:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_project_1')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -336,7 +354,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema.8]
@@ -345,11 +364,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'nonexistent')))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC')))), equals(events.properties.`$group_0`, 'nonexistent')))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -366,7 +385,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_group_key_filter[new_events_schema]
@@ -375,11 +395,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -396,17 +416,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -414,18 +435,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 05:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 05:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 5
OFFSET 0 SETTINGS readonly=2,
@@ -440,7 +463,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema.2]
@@ -449,11 +473,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -470,17 +494,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema.3]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -488,18 +513,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6', 'trace_5', 'trace_4', 'trace_3', 'trace_2')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 01:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6', 'trace_5', 'trace_4', 'trace_3', 'trace_2')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 5
OFFSET 4 SETTINGS readonly=2,
@@ -514,7 +541,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema.4]
@@ -523,11 +551,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -544,17 +572,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema.5]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -562,18 +591,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6', 'trace_5', 'trace_4', 'trace_3', 'trace_2', 'trace_1', 'trace_0')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-14 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-15 10:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace_10', 'trace_9', 'trace_8', 'trace_7', 'trace_6', 'trace_5', 'trace_4', 'trace_3', 'trace_2', 'trace_1', 'trace_0')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 5
OFFSET 8 SETTINGS readonly=2,
@@ -588,7 +619,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_pagination[new_events_schema]
@@ -597,11 +629,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-08 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2025-01-16 00:10:59', 'UTC'))))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('today', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2025-01-09 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -618,17 +650,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_properties_filter_with_multiple_events_in_group[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -636,18 +669,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace1')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace1')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -662,7 +697,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_properties_filter_with_multiple_events_in_group[new_events_schema.2]
@@ -671,11 +707,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'baz'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'baz'), 0)))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -692,17 +728,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_properties_filter_with_multiple_events_in_group[new_events_schema.3]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -710,18 +747,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:10:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace1')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:10:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace1')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -736,7 +775,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_properties_filter_with_multiple_events_in_group[new_events_schema.4]
@@ -745,11 +785,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'barz'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'barz'), 0)))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -766,7 +806,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_properties_filter_with_multiple_events_in_group[new_events_schema]
@@ -775,11 +816,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -796,17 +837,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_trace_property_filter_for_event_group[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -814,18 +856,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:55:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:15:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace1')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:55:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:15:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace1')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -840,7 +884,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_trace_property_filter_for_event_group[new_events_schema.2]
@@ -849,11 +894,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -870,17 +915,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_trace_property_filter_for_event_group[new_events_schema.3]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_session_id`)), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS id,
+ any(if(notEquals(toJSONString(events.properties.^`$ai_session_id`), '{}'), toJSONString(events.properties.^`$ai_session_id`), if(isNull(nullIf(toString(events.properties.`$ai_session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_session_id`), '[]'), '{}'), toString(events.properties.`$ai_session_id`))))) AS ai_session_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS last_timestamp,
ifNull(nullIf(argMinIf(events.distinct_id, toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), ''), argMin(events.distinct_id, toTimeZone(events.timestamp, 'UTC'))) AS first_distinct_id,
- round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
+ round(coalesce(nullIf(maxIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_trace'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), 0), if(and(equals(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), notEquals(events.event, '$ai_generation'))), 0), greater(countIf(and(ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0), equals(events.event, '$ai_generation'))), 0)), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), and(equals(events.event, '$ai_generation'), ifNull(greater(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), 0), 0))), sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_latency`, 'Float64'), 'Float64'), or(isNull(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))), 2) AS total_latency,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS input_tokens,
sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))) AS output_tokens,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_input_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS input_cost,
@@ -888,18 +934,20 @@
round(sumIf(accurateCastOrNull(events.properties.`$ai_request_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS request_cost,
round(sumIf(accurateCastOrNull(events.properties.`$ai_web_search_cost_usd`, 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS web_search_cost,
round(sumIf(accurateCastOrNull(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), 'Float64'), in(events.event, tuple('$ai_generation', '$ai_embedding'))), 10) AS total_cost,
- arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'))), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_parent_id`)), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_input_state`)), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
- argMinIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_output_state`)), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
- ifNull(argMinIf(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_name`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
- countIf(or(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_error`)), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_is_error`)), if(isNull(nullIf(toString(events.properties.`$ai_is_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_is_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_is_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_is_error`), '[]'), '{}'), toString(events.properties.`$ai_is_error`)))), 'true'))) AS error_count,
- any(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_support_impersonated)), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
- arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
+ arrayDistinct(arraySort(x -> x.3, groupArrayIf(tuple(events.uuid, events.event, toTimeZone(events.timestamp, 'UTC'), concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), or(in(events.event, tuple('$ai_metric', '$ai_feedback')), equals(toString(if(notEquals(toJSONString(events.properties.^`$ai_parent_id`), '{}'), toJSONString(events.properties.^`$ai_parent_id`), if(isNull(nullIf(toString(events.properties.`$ai_parent_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_parent_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_parent_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_parent_id`), '[]'), '{}'), toString(events.properties.`$ai_parent_id`))))), toString(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))))))))) AS events,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_input_state`), '{}'), toJSONString(events.properties.^`$ai_input_state`), if(isNull(nullIf(toString(events.properties.`$ai_input_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_input_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_input_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_input_state`), '[]'), '{}'), toString(events.properties.`$ai_input_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS input_state,
+ argMinIf(if(notEquals(toJSONString(events.properties.^`$ai_output_state`), '{}'), toJSONString(events.properties.^`$ai_output_state`), if(isNull(nullIf(toString(events.properties.`$ai_output_state`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_output_state`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_output_state`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_output_state`), '[]'), '{}'), toString(events.properties.`$ai_output_state`)))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')) AS output_state,
+ ifNull(argMinIf(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'), equals(events.event, '$ai_trace')), argMin(ifNull(if(notEquals(toJSONString(events.properties.^`$ai_span_name`), '{}'), toJSONString(events.properties.^`$ai_span_name`), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), if(notEquals(toJSONString(events.properties.^`$ai_trace_name`), '{}'), toJSONString(events.properties.^`$ai_trace_name`), if(isNull(nullIf(toString(events.properties.`$ai_trace_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_name`), '[]'), '{}'), toString(events.properties.`$ai_trace_name`))))), toTimeZone(events.timestamp, 'UTC'))) AS trace_name,
+ countIf(or(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_error`), '{}'), toJSONString(events.properties.^`$ai_error`), if(isNull(nullIf(toString(events.properties.`$ai_error`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_error`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_error`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_error`), '[]'), '{}'), toString(events.properties.`$ai_error`))))), equals(CAST(events.properties.`$ai_is_error`, 'Nullable(String)'), 'true'))) AS error_count,
+ any(if(notEquals(toJSONString(events.properties.^ai_support_impersonated), '{}'), toJSONString(events.properties.^ai_support_impersonated), if(isNull(nullIf(toString(events.properties.ai_support_impersonated), '')), NULL, if(and(in(ascii(toString(events.properties.ai_support_impersonated)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_support_impersonated)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_support_impersonated), '[]'), '{}'), toString(events.properties.ai_support_impersonated))))) AS is_support_trace,
+ arrayFilter(x -> ifNull(notEquals(x, ''), 1), arrayDistinct(splitByChar(',', arrayStringConcat(groupArrayIf(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), and(equals(events.event, '$ai_generation'), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ifNull(notEquals(toString(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`))))), ''), 1))), ',')))) AS tools
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:52:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:12:00', 'UTC'))))), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), tuple('trace1')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
+ WHERE and(equals(events.team_id, 99999), and(in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:52:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:12:00', 'UTC'))))), in(CAST(events.properties.`$ai_trace_id`, 'Nullable(String)'), tuple('trace1')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))
ORDER BY first_timestamp DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -914,7 +962,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_trace_property_filter_for_event_group[new_events_schema.4]
@@ -923,11 +972,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), 'runnable'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), and(ifNull(equals(CAST(events.properties.`$ai_span_name`, 'Nullable(String)'), 'runnable'), 0), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0))))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -944,7 +993,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTracesQueryRunner.test_trace_property_filter_for_event_group[new_events_schema]
@@ -953,11 +1003,11 @@
min(first_ts) AS min_timestamp,
max(last_ts) AS max_timestamp
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))) AS trace_id,
min(toTimeZone(events.timestamp, 'UTC')) AS first_ts,
max(toTimeZone(events.timestamp, 'UTC')) AS last_ts
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_trace_id`)), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_span_name`)), if(isNull(nullIf(toString(events.properties.`$ai_span_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_span_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_span_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_span_name`), '[]'), '{}'), toString(events.properties.`$ai_span_name`)))), 'runnable'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_span', '$ai_generation', '$ai_embedding', '$ai_metric', '$ai_feedback', '$ai_trace')), and(isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`))))), notEquals(if(notEquals(toJSONString(events.properties.^`$ai_trace_id`), '{}'), toJSONString(events.properties.^`$ai_trace_id`), if(isNull(nullIf(toString(events.properties.`$ai_trace_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_trace_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_trace_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_trace_id`), '[]'), '{}'), toString(events.properties.`$ai_trace_id`)))), ''), and(greaterOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-11-30 23:50:00', 'UTC'))), lessOrEquals(events.timestamp, assumeNotNull(toDateTime('2024-12-01 00:20:00', 'UTC')))), ifNull(equals(CAST(events.properties.`$ai_span_name`, 'Nullable(String)'), 'runnable'), 0)))
GROUP BY trace_id
HAVING and(lessOrEquals(min(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime64('2024-12-01 00:10:00.000000', 6, 'UTC'))), greaterOrEquals(max(toTimeZone(events.timestamp, 'UTC')), assumeNotNull(toDateTime('2024-12-01 00:00:00', 'UTC'))))
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
@@ -974,6 +1024,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/test/__snapshots__/test_events_query_runner.new_events_schema.ambr b/posthog/hogql_queries/test/__snapshots__/test_events_query_runner.new_events_schema.ambr
index cd18bc96ae5e..90f6793f8223 100644
--- a/posthog/hogql_queries/test/__snapshots__/test_events_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/test/__snapshots__/test_events_query_runner.new_events_schema.ambr
@@ -1,9 +1,11 @@
# serializer version: 1
# name: TestEventsQueryRunner.test_absolute_date_range[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -25,7 +27,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_not_returned_for_aggregation_query[new_events_schema]
@@ -49,7 +52,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_not_returned_for_non_timestamp_order[new_events_schema]
@@ -77,12 +81,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_asc[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -105,12 +110,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_asc[new_events_schema.2]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -133,12 +139,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_asc[new_events_schema]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -161,12 +168,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_desc[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -189,12 +197,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_desc[new_events_schema.2]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -217,12 +226,13 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_pagination_multi_page_desc[new_events_schema]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^idx)), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
+ SELECT if(notEquals(toJSONString(events.properties.^idx), '{}'), toJSONString(events.properties.^idx), if(isNull(nullIf(toString(events.properties.idx), '')), NULL, if(and(in(ascii(toString(events.properties.idx)), tuple(91, 123)), in(ascii(toJSONString(events.properties.idx)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.idx), '[]'), '{}'), toString(events.properties.idx)))) AS idx,
toTimeZone(events.timestamp, 'UTC') AS timestamp
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
@@ -245,14 +255,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_cursor_with_star_select[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -274,14 +287,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_element_chain_property_filter[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -303,21 +319,24 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_presorted_events_table[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^some_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^some_prop)), if(isNull(nullIf(toString(events.properties.some_prop), '')), NULL, if(and(in(ascii(toString(events.properties.some_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.some_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.some_prop), '[]'), '{}'), toString(events.properties.some_prop)))), 'a'), 0), equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.some_prop, 'Nullable(String)'), 'a'), 0), equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC')))
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC, events.uuid ASC
- LIMIT 101)), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^some_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^some_prop)), if(isNull(nullIf(toString(events.properties.some_prop), '')), NULL, if(and(in(ascii(toString(events.properties.some_prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.some_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.some_prop), '[]'), '{}'), toString(events.properties.some_prop)))), 'a'), 0), equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC'))))
+ LIMIT 101)), and(ifNull(equals(CAST(events.properties.some_prop, 'Nullable(String)'), 'a'), 0), equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC'))))
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC, events.uuid ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -332,14 +351,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_presorted_events_table_multiple_order_by[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -362,14 +384,17 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_presorted_events_table_order_by_event[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
@@ -391,22 +416,25 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestEventsQueryRunner.test_presorted_events_table_order_by_property[new_events_schema]
'''
- SELECT tuple(events.uuid, events.event, JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
+ SELECT tuple(events.uuid, events.event, concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}'), toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC'), events.person_mode) AS `tuple(uuid, event, properties, toTimeZone(timestamp, 'UTC'), team_id, distinct_id, elements_chain, toTimeZone(created_at, 'UTC'), person_mode)`
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), globalIn(events.uuid,
(SELECT events.uuid AS uuid
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC')))
- ORDER BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^priority)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^priority)), if(isNull(nullIf(toString(events.properties.priority), '')), NULL, if(and(in(ascii(toString(events.properties.priority)), tuple(91, 123)), in(ascii(toJSONString(events.properties.priority)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.priority), '[]'), '{}'), toString(events.properties.priority)))) ASC
+ ORDER BY if(notEquals(toJSONString(events.properties.^priority), '{}'), toJSONString(events.properties.^priority), if(isNull(nullIf(toString(events.properties.priority), '')), NULL, if(and(in(ascii(toString(events.properties.priority)), tuple(91, 123)), in(ascii(toJSONString(events.properties.priority)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.priority), '[]'), '{}'), toString(events.properties.priority)))) ASC
LIMIT 101)), and(equals(events.event, '$pageview'), less(events.timestamp, toDateTime64('2021-01-21 00:00:05.000000', 6, 'UTC')), greater(events.timestamp, toDateTime64('2021-01-14 00:00:00.000000', 6, 'UTC'))))
- ORDER BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^priority)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^priority)), if(isNull(nullIf(toString(events.properties.priority), '')), NULL, if(and(in(ascii(toString(events.properties.priority)), tuple(91, 123)), in(ascii(toJSONString(events.properties.priority)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.priority), '[]'), '{}'), toString(events.properties.priority)))) ASC
+ ORDER BY if(notEquals(toJSONString(events.properties.^priority), '{}'), toJSONString(events.properties.^priority), if(isNull(nullIf(toString(events.properties.priority), '')), NULL, if(and(in(ascii(toString(events.properties.priority)), tuple(91, 123)), in(ascii(toJSONString(events.properties.priority)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.priority), '[]'), '{}'), toString(events.properties.priority)))) ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
@@ -420,6 +448,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.new_events_schema.ambr b/posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.new_events_schema.ambr
index 5cd0be683e8d..94e5788723c6 100644
--- a/posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.new_events_schema.ambr
@@ -19,7 +19,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestInsightActorsQueryRunner.test_insight_persons_trends_groups_query[new_events_schema]
@@ -60,7 +61,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestInsightActorsQueryRunner.test_insight_persons_trends_query_with_argmaxV1[new_events_schema]
@@ -88,7 +90,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
+ WHERE and(equals(e.team_id, 99999), ifNull(notEquals(CAST(e.person_properties.email, 'Nullable(String)'), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
GROUP BY actor_id) AS source
INNER JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person.properties, 'name'), ''), 'null'), '^"|"$', '')), person.version), 1) AS properties___name,
@@ -107,7 +109,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
+ WHERE and(equals(e.team_id, 99999), ifNull(notEquals(CAST(e.person_properties.email, 'Nullable(String)'), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
GROUP BY actor_id) AS source)))
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'US/Pacific'), person.version), plus(now64(6, 'US/Pacific'), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, source.actor_id)
@@ -125,7 +127,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestInsightActorsQueryRunner.test_insight_persons_trends_query_with_argmaxV2[new_events_schema]
@@ -153,7 +156,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
+ WHERE and(equals(e.team_id, 99999), ifNull(notEquals(CAST(e.person_properties.email, 'Nullable(String)'), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
GROUP BY actor_id) AS source
INNER JOIN
(SELECT person.id AS id,
@@ -175,7 +178,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
+ WHERE and(equals(e.team_id, 99999), ifNull(notEquals(CAST(e.person_properties.email, 'Nullable(String)'), '[email protected]'), 1), greaterOrEquals(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), less(timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'US/Pacific')), equals(e.event, '$pageview')))
GROUP BY actor_id) AS source)))
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'US/Pacific'), person.version), plus(now64(6, 'US/Pacific'), toIntervalDay(1))))))) SETTINGS optimize_aggregation_in_order=1) AS persons ON equals(persons.id, source.actor_id)
@@ -193,6 +196,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/test/__snapshots__/test_sessions_query_runner.new_events_schema.ambr b/posthog/hogql_queries/test/__snapshots__/test_sessions_query_runner.new_events_schema.ambr
index bf9fd1cb1e39..77dbb50cd02e 100644
--- a/posthog/hogql_queries/test/__snapshots__/test_sessions_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/test/__snapshots__/test_sessions_query_runner.new_events_schema.ambr
@@ -12,7 +12,7 @@
WHERE and(globalIn(sessions.session_id,
(SELECT DISTINCT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://example.com/pricing'), 0), greater(events.timestamp, toDateTime64('2024-01-01 00:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('2024-01-01 14:00:05.000000', 6, 'UTC'))))), less(sessions.`$start_timestamp`, toDateTime64('2024-01-01 14:00:05.000000', 6, 'UTC')), greater(sessions.`$start_timestamp`, toDateTime64('2024-01-01 00:00:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), ifNull(equals(CAST(events.properties.`$current_url`, 'Nullable(String)'), 'https://example.com/pricing'), 0), greater(events.timestamp, toDateTime64('2024-01-01 00:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('2024-01-01 14:00:05.000000', 6, 'UTC'))))), less(sessions.`$start_timestamp`, toDateTime64('2024-01-01 14:00:05.000000', 6, 'UTC')), greater(sessions.`$start_timestamp`, toDateTime64('2024-01-01 00:00:00.000000', 6, 'UTC')))
ORDER BY sessions.session_id ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
@@ -27,6 +27,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/hogql_queries/test/__snapshots__/test_sessions_timeline_query_runner.new_events_schema.ambr b/posthog/hogql_queries/test/__snapshots__/test_sessions_timeline_query_runner.new_events_schema.ambr
index 378dc2d89d84..f9eb441a24a9 100644
--- a/posthog/hogql_queries/test/__snapshots__/test_sessions_timeline_query_runner.new_events_schema.ambr
+++ b/posthog/hogql_queries/test/__snapshots__/test_sessions_timeline_query_runner.new_events_schema.ambr
@@ -28,9 +28,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -71,7 +73,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_before_and_after_defaults[new_events_schema]
@@ -103,9 +106,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -146,7 +151,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_event_limit_and_has_more[new_events_schema]
@@ -178,9 +184,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -221,7 +229,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_formal_and_informal_sessions_global[new_events_schema]
@@ -253,9 +262,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -296,7 +307,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_formal_session_with_recording[new_events_schema]
@@ -328,9 +340,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -371,7 +385,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_formal_sessions_for_person[new_events_schema]
@@ -403,9 +418,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -446,7 +463,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionsTimelineQueryRunner.test_formal_sessions_global[new_events_schema]
@@ -478,9 +496,11 @@
if(not(empty(event_source__override.distinct_id)), event_source__override.person_id, event_source.person_id) AS person_id,
toTimeZone(event_source.timestamp, 'UTC') AS timestamp,
event_source.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(event_source.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(event_source.properties.`$feature_flags`), mapValues(event_source.properties.`$feature_flags`)), if(empty(event_source.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), event_source.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(event_source.temporary_properties)))), ','), '}') AS properties,
event_source.distinct_id AS distinct_id,
event_source.elements_chain AS elements_chain,
event_source.properties.`$session_id` AS session_id,
@@ -521,6 +541,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/models/event/sql.py b/posthog/models/event/sql.py
index c6ddee6c379d..55e7587a8909 100644
--- a/posthog/models/event/sql.py
+++ b/posthog/models/event/sql.py
@@ -1,7 +1,6 @@
from django.conf import settings
from posthog.hogql.escape_sql import escape_clickhouse_identifier, escape_clickhouse_string
-from posthog.hogql.functions.udfs import JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME
from posthog.clickhouse.base_sql import COPY_ROWS_BETWEEN_TEAMS_BASE_SQL
from posthog.clickhouse.cluster import ON_CLUSTER_CLAUSE
@@ -68,7 +67,7 @@ def json_property_presence_expr(column: str, prop: str) -> str:
Mirrors the HogQL resolver's JSONHas lowering, with the materialized-column rule that an empty
value is absent: a declared path is present when it is not null and not empty; a dynamic path
- is present when its scalar read is a non-empty string or its sub-object holds a non-empty value.
+ is present when its scalar read is a non-empty string or its sub-object holds any value.
ClickHouse's JSONHas() cannot be used directly on a JSON-typed column — it does not see typed
paths or nested objects there.
"""
@@ -96,13 +95,9 @@ def json_property_presence_expr(column: str, prop: str) -> str:
head_document = head if subcolumns[parts[0]] in ("String", "Nullable(String)") else f"toJSONString({head})"
tail = ", ".join(escape_clickhouse_string(part) for part in parts[1:])
return f"JSONHas(ifNull({head_document}, ''), {tail})"
- # The sub-object serializes the '' default of every declared path under it, so strip empty
- # values before the emptiness check.
+ # No declared path is nested, so the sub-object text holds only values the SDK sent.
sub_object = f"{column_sql}.^{path_sql}"
- return (
- f"(notEmpty(ifNull(toString({scalar}), '')) "
- f"OR {JSON_STRIP_EMPTY_STRINGS_AND_NULLS_CLICKHOUSE_NAME}(toJSONString({sub_object})) != '{{}}')"
- )
+ return f"(notEmpty(ifNull(toString({scalar}), '')) OR toJSONString({sub_object}) != '{{}}')"
def TRUNCATE_EVENTS_TABLE_SQL():
diff --git a/posthog/models/property/util.py b/posthog/models/property/util.py
index 8a750a47cdcd..28a90d4b9c60 100644
--- a/posthog/models/property/util.py
+++ b/posthog/models/property/util.py
@@ -77,13 +77,21 @@ def get_property_string_expr(
return trim_quotes_expr(f"JSONExtractRaw({table_string}{column}, {var})"), False
+def _json_events_to_json_string_expr(value: str) -> str:
+ serialized = f"toJSONString({value})"
+ # With slash escaping disabled, a backslash before '/' belongs to the value and must survive.
+ return f"if(getSetting('output_format_json_escape_forward_slashes'), replaceAll({serialized}, '\\\\/', '/'), {serialized})"
+
+
def _json_events_property_expr(property_name: PropertyName, var: str, column_ref: str) -> tuple[str, bool]:
scalar_value = _json_events_subcolumn_expr(property_name, var, column_ref)
- object_value = f"JSONStripEmptyStringsAndNulls(toJSONString({_json_events_subcolumn_expr(property_name, var, column_ref, sub_object=True)}))"
+ object_value = _json_events_to_json_string_expr(
+ _json_events_subcolumn_expr(property_name, var, column_ref, sub_object=True)
+ )
scalar_string = f"toString({scalar_value})"
# Arrays and maps read as JSON text. Their plain text starts with '[' or '{', which a string can too, but a
# string's JSON form starts with '"' (see the HogQL resolver).
- scalar_json = f"toJSONString({scalar_value})"
+ scalar_json = _json_events_to_json_string_expr(scalar_value)
# 91 and 123 are '[' and '{'; compared by code so no brace literal reaches callers that str.format the SQL.
is_container = f"ascii({scalar_string}) IN (91, 123) AND ascii({scalar_json}) IN (91, 123)"
raw_value = (
diff --git a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
index 0796c6e65b04..3ddc459290cc 100644
--- a/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
+++ b/posthog/models/web_preaggregated/__snapshots__/test_web_pre_aggregated_timezones.new_events_schema.ambr
@@ -8,7 +8,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -39,7 +39,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_boundary_behavior_explicit[new_events_schema.1]
@@ -51,7 +52,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -82,7 +83,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_boundary_behavior_explicit[new_events_schema.2]
@@ -94,7 +96,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -125,7 +127,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_boundary_behavior_explicit[new_events_schema]
@@ -137,7 +140,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -168,7 +171,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_00_Pacific_UTC_08_00_[new_events_schema]
@@ -180,7 +184,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -211,7 +215,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_01_New_York_UTC_05_00_[new_events_schema]
@@ -223,7 +228,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -254,7 +259,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_02_Sao_Paulo_UTC_03_00_[new_events_schema]
@@ -266,7 +272,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -297,7 +303,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_03_UTC_UTC_00_00_[new_events_schema]
@@ -309,7 +316,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -340,7 +347,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_04_Berlin_UTC_01_00_[new_events_schema]
@@ -352,7 +360,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -383,7 +391,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_05_Cairo_UTC_02_00_[new_events_schema]
@@ -395,7 +404,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -426,7 +435,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_06_Moscow_UTC_03_00_[new_events_schema]
@@ -438,7 +448,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -469,7 +479,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_07_Pakistan_UTC_05_00_[new_events_schema]
@@ -481,7 +492,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -512,7 +523,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_08_Tokyo_UTC_09_00_[new_events_schema]
@@ -524,7 +536,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -555,7 +567,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_09_Sydney_UTC_11_00_[new_events_schema]
@@ -567,7 +580,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -598,7 +611,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTimezonePreAggregatedIntegration.test_timezone_hourly_bucketing_10_Auckland_UTC_12_00_[new_events_schema]
@@ -610,7 +624,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -641,6 +655,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_by_top_level_event_property.new_events_schema.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_by_top_level_event_property.new_events_schema.ambr
index dfe0fd19918b..882438ecaf42 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_by_top_level_event_property.new_events_schema.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_by_top_level_event_property.new_events_schema.ambr
@@ -24,10 +24,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^something)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^something)), if(isNull(nullIf(toString(events.properties.something), '')), NULL, if(and(in(ascii(toString(events.properties.something)), tuple(91, 123)), in(ascii(toJSONString(events.properties.something)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.something), '[]'), '{}'), toString(events.properties.something))))), '%paul.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^something), '{}'), toJSONString(events.properties.^something), if(isNull(nullIf(toString(events.properties.something), '')), NULL, if(and(in(ascii(toString(events.properties.something)), tuple(91, 123)), in(ascii(toJSONString(events.properties.something)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.something), '[]'), '{}'), toString(events.properties.something))))), '%paul.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -45,7 +45,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_does_not_match_regex_event_properties[new_events_schema]
@@ -73,10 +74,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -94,7 +95,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_flags_0_session_1_matches_target_flag_is_True[new_events_schema]
@@ -122,10 +124,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -144,7 +146,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_flags_1_session_2_matches_target_flag_is_False[new_events_schema]
@@ -172,10 +175,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'false'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'false'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -194,7 +197,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_flags_2_sessions_1_and_2_match_target_flag_is_set[new_events_schema]
@@ -222,10 +226,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL))), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(in(events.event, ['$pageview', 'bar', 'baz', 'foo']), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL))), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -244,7 +248,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_flags_3_sessions_3_and_4_match_target_flag_is_not_set[new_events_schema]
@@ -272,10 +277,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -293,7 +298,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_0.test_can_filter_for_two_is_not_event_properties[new_events_schema]
@@ -321,10 +327,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-one`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-one`)), if(isNull(nullIf(toString(events.properties.`probe-one`), '')), NULL, if(and(in(ascii(toString(events.properties.`probe-one`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`probe-one`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`probe-one`), '[]'), '{}'), toString(events.properties.`probe-one`)))), 'val'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-two`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-two`)), if(isNull(nullIf(toString(events.properties.`probe-two`), '')), NULL, if(and(in(ascii(toString(events.properties.`probe-two`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`probe-two`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`probe-two`), '[]'), '{}'), toString(events.properties.`probe-two`)))), 'val'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(CAST(events.properties.`probe-one`, 'Nullable(String)'), 'val'), 0), ifNull(equals(CAST(events.properties.`probe-two`, 'Nullable(String)'), 'val'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -342,7 +348,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_does_not_contain_event_properties[new_events_schema]
@@ -370,10 +377,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^something)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^something)), if(isNull(nullIf(toString(events.properties.something), '')), NULL, if(and(in(ascii(toString(events.properties.something)), tuple(91, 123)), in(ascii(toJSONString(events.properties.something)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.something), '[]'), '{}'), toString(events.properties.something))))), '%paul.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^something), '{}'), toJSONString(events.properties.^something), if(isNull(nullIf(toString(events.properties.something), '')), NULL, if(and(in(ascii(toString(events.properties.something)), tuple(91, 123)), in(ascii(toJSONString(events.properties.something)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.something), '[]'), '{}'), toString(events.properties.something))))), '%paul.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -391,7 +398,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_does_not_match_regex_event_properties[new_events_schema]
@@ -419,10 +427,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -440,7 +448,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_flags_0_session_1_matches_target_flag_is_True[new_events_schema]
@@ -468,10 +477,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -490,7 +499,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_flags_1_session_2_matches_target_flag_is_False[new_events_schema]
@@ -518,10 +528,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -540,7 +550,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_flags_2_sessions_1_and_2_match_target_flag_is_set[new_events_schema]
@@ -568,10 +579,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -590,7 +601,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_flags_3_sessions_3_and_4_match_target_flag_is_not_set[new_events_schema]
@@ -618,10 +630,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), isNotNull(if(has(events.properties.`$feature_flags`, 'target-flag'), multiIf(ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$false'), 0), 'false', ifNull(equals(events.properties.`$feature_flags`['target-flag'], '$true'), 0), 'true', events.properties.`$feature_flags`['target-flag']), NULL)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -639,7 +651,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByTopLevelEventProperty_1.test_can_filter_for_two_is_not_event_properties[new_events_schema]
@@ -667,10 +680,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-one`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-one`)), if(isNull(nullIf(toString(events.properties.`probe-one`), '')), NULL, if(and(in(ascii(toString(events.properties.`probe-one`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`probe-one`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`probe-one`), '[]'), '{}'), toString(events.properties.`probe-one`)))), 'val'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-two`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`probe-two`)), if(isNull(nullIf(toString(events.properties.`probe-two`), '')), NULL, if(and(in(ascii(toString(events.properties.`probe-two`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`probe-two`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`probe-two`), '[]'), '{}'), toString(events.properties.`probe-two`)))), 'val'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(CAST(events.properties.`probe-one`, 'Nullable(String)'), 'val'), 0), ifNull(equals(CAST(events.properties.`probe-two`, 'Nullable(String)'), 'val'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -688,6 +701,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.new_events_schema.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.new_events_schema.ambr
index e1f4b5c09d7a..a291ec7c29a2 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.new_events_schema.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.new_events_schema.ambr
@@ -24,10 +24,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), if(isNull(nullIf(toString(events.person_properties.rgInternal), '')), NULL, if(and(in(ascii(toString(events.person_properties.rgInternal)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.rgInternal)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.rgInternal), '[]'), '{}'), toString(events.person_properties.rgInternal)))), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(CAST(events.person_properties.rgInternal, 'Nullable(String)'), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -62,7 +62,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -76,8 +76,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_8)s), person.version), plus(now64(6, %(hogql_val_9)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_10)s), 6, %(hogql_val_11)s)), ifNull(equals(events__person.properties___rgInternal, %(hogql_val_12)s), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_10)s), 6, %(hogql_val_11)s)), ifNull(equals(events__person.properties___rgInternal, %(hogql_val_12)s), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -112,7 +112,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -126,8 +126,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, %(hogql_val_8)s), person.version), plus(now64(6, %(hogql_val_9)s), toIntervalDay(1)))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_10)s), 6, %(hogql_val_11)s)), ifNull(equals(events__person.properties___rgInternal, %(hogql_val_12)s), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_10)s), 6, %(hogql_val_11)s)), ifNull(equals(events__person.properties___rgInternal, %(hogql_val_12)s), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -162,10 +162,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), if(isNull(nullIf(toString(events.person_properties.rgInternal), '')), NULL, if(and(in(ascii(toString(events.person_properties.rgInternal)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.rgInternal)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.rgInternal), '[]'), '{}'), toString(events.person_properties.rgInternal)))), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(CAST(events.person_properties.rgInternal, 'Nullable(String)'), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -200,10 +200,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^rgInternal)), if(isNull(nullIf(toString(events.person_properties.rgInternal), '')), NULL, if(and(in(ascii(toString(events.person_properties.rgInternal)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.rgInternal)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.rgInternal), '[]'), '{}'), toString(events.person_properties.rgInternal)))), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, %(hogql_val_7)s), 6, %(hogql_val_8)s)), ifNull(equals(CAST(events.person_properties.rgInternal, 'Nullable(String)'), %(hogql_val_9)s), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -238,10 +238,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -260,7 +260,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_01_poe_v2_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -288,10 +289,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -310,7 +311,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_02_poe_v2_and_materialized_columns_off_with_materialization[new_events_schema]
@@ -338,10 +340,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -360,7 +362,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_03_poe_v2_and_materialized_columns_off_without_materialization[new_events_schema]
@@ -388,10 +391,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -410,7 +413,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_04_poe_off_and_materialized_columns_allowed_with_materialization[new_events_schema]
@@ -438,7 +442,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -455,8 +459,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -475,7 +479,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_05_poe_off_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -503,7 +508,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -520,8 +525,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -540,7 +545,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_06_poe_off_and_materialized_columns_not_allowed_with_materialization[new_events_schema]
@@ -568,7 +574,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -585,8 +591,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -605,7 +611,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_07_poe_off_and_materialized_columns_not_allowed_without_materialization[new_events_schema]
@@ -633,7 +640,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -650,8 +657,8 @@
WHERE equals(person.team_id, 99999)
GROUP BY person.id
HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))))) SETTINGS optimize_aggregation_in_order=1) AS events__person ON equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), events__person.id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__person.properties___email, 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -670,7 +677,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_08_poe_v1_and_materialized_columns_allowed_with_materialization[new_events_schema]
@@ -698,10 +706,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -720,7 +728,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_09_poe_v1_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -748,10 +757,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -770,7 +779,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_10_poe_v1_and_not_materialized_columns_not_allowed_with_materialization[new_events_schema]
@@ -798,10 +808,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -820,7 +830,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_event_filter_with_person_properties_materialized_11_poe_v1_and_not_materialized_columns_not_allowed_without_materialization[new_events_schema]
@@ -848,10 +859,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -870,7 +881,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_00_poe_v2_and_materialized_columns_allowed_with_materialization[new_events_schema]
@@ -898,9 +910,9 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -917,7 +929,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_01_poe_v2_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -945,9 +958,9 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -964,7 +977,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_02_poe_v2_and_materialized_columns_off_with_materialization[new_events_schema]
@@ -992,9 +1006,9 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1011,7 +1025,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_03_poe_v2_and_materialized_columns_off_without_materialization[new_events_schema]
@@ -1039,9 +1054,9 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(events.person_id, '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1058,7 +1073,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_04_poe_off_and_materialized_columns_allowed_with_materialization[new_events_schema]
@@ -1086,7 +1102,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1094,7 +1110,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1111,7 +1127,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_05_poe_off_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -1139,7 +1156,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1147,7 +1164,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1164,7 +1181,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_06_poe_off_and_materialized_columns_not_allowed_with_materialization[new_events_schema]
@@ -1192,7 +1210,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1200,7 +1218,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1217,7 +1235,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_07_poe_off_and_materialized_columns_not_allowed_without_materialization[new_events_schema]
@@ -1245,7 +1264,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1253,7 +1272,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1270,7 +1289,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_08_poe_v1_and_materialized_columns_allowed_with_materialization[new_events_schema]
@@ -1298,7 +1318,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1306,7 +1326,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1323,7 +1343,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_09_poe_v1_and_materialized_columns_allowed_without_materialization[new_events_schema]
@@ -1351,7 +1372,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1359,7 +1380,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1376,7 +1397,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_10_poe_v1_and_not_materialized_columns_not_allowed_with_materialization[new_events_schema]
@@ -1404,7 +1426,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1412,7 +1434,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1429,7 +1451,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseSessionRecordingsListFromQuery.test_person_id_filter_11_poe_v1_and_not_materialized_columns_not_allowed_without_materialization[new_events_schema]
@@ -1457,7 +1480,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1465,7 +1488,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -1482,7 +1505,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_action_filter[new_events_schema.1]
@@ -1510,10 +1534,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1532,7 +1556,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_action_filter[new_events_schema.2]
@@ -1560,10 +1585,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1582,7 +1607,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_action_filter[new_events_schema.3]
@@ -1610,10 +1636,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1632,7 +1658,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_action_filter[new_events_schema]
@@ -1660,10 +1687,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(equals(events.properties.`$browser`, 'Firefox'), equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1682,7 +1709,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_all_filters_at_once[new_events_schema]
@@ -1710,7 +1738,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -1718,19 +1746,19 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom-event'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000))))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), and(globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom-event'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000))))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0), greater(duration, 60.0))
ORDER BY start_time DESC,
@@ -1747,7 +1775,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_any_event_filter_with_properties[new_events_schema.1]
@@ -1775,10 +1804,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1797,7 +1826,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_any_event_filter_with_properties[new_events_schema.2]
@@ -1825,10 +1855,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Firefox'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1847,7 +1877,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_any_event_filter_with_properties[new_events_schema]
@@ -1875,10 +1906,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1897,7 +1928,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter[new_events_schema.1]
@@ -1925,10 +1957,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1947,7 +1979,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter[new_events_schema]
@@ -1975,10 +2008,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -1997,7 +2030,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_has_ttl_applied_too[new_events_schema]
@@ -2025,10 +2059,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2047,7 +2081,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_active_sessions[new_events_schema.1]
@@ -2075,10 +2110,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2097,7 +2132,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_active_sessions[new_events_schema]
@@ -2125,10 +2161,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2147,7 +2183,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_group_filter[new_events_schema.1]
@@ -2175,15 +2212,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2202,7 +2239,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_group_filter[new_events_schema.2]
@@ -2230,15 +2268,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 2))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_2 ON equals(events.properties.`$group_2`, events__group_2.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_2.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_2.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2257,7 +2295,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_group_filter[new_events_schema]
@@ -2285,15 +2324,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(events__group_1.properties___name, 'org one'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(events__group_1.properties___name, 'org one'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2312,7 +2351,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema.1]
@@ -2340,16 +2380,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2368,7 +2408,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema.2]
@@ -2396,16 +2437,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2424,7 +2465,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema]
@@ -2452,10 +2494,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2474,7 +2516,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_person_properties[new_events_schema.1]
@@ -2502,10 +2545,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'something else'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'something else'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2524,7 +2567,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_person_properties[new_events_schema]
@@ -2552,10 +2596,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2574,7 +2618,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_properties[new_events_schema.1]
@@ -2602,10 +2647,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2624,7 +2669,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_hogql_properties[new_events_schema]
@@ -2652,10 +2698,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2674,7 +2720,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_matching_on_session_id[new_events_schema.1]
@@ -2702,10 +2749,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2724,7 +2771,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_matching_on_session_id[new_events_schema]
@@ -2752,10 +2800,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2774,7 +2822,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_properties[new_events_schema.1]
@@ -2802,10 +2851,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2824,7 +2873,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_properties[new_events_schema.2]
@@ -2852,10 +2902,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2874,7 +2924,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_properties[new_events_schema.3]
@@ -2902,10 +2953,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Safari'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), equals(events.properties.`$browser`, 'Safari')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2924,7 +2975,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_properties[new_events_schema]
@@ -2952,10 +3004,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -2974,7 +3026,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_test_accounts_excluded[new_events_schema.1]
@@ -3002,10 +3055,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -3024,7 +3077,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_test_accounts_excluded[new_events_schema]
@@ -3052,28 +3106,28 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
LIMIT 1000000)), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -3091,7 +3145,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_event_filter_with_two_events_and_multiple_teams[new_events_schema]
@@ -3119,16 +3174,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageleave'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageleave'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3147,7 +3202,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_filter_with_person_properties_exact[new_events_schema]
@@ -3175,10 +3231,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -3197,7 +3253,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_filter_with_person_properties_not_contains[new_events_schema]
@@ -3225,10 +3282,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%gmail.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%gmail.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -3246,7 +3303,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema.1]
@@ -3274,16 +3332,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3302,7 +3360,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema.2]
@@ -3330,16 +3389,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3358,7 +3417,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema.3]
@@ -3386,16 +3446,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bar)), if(isNull(nullIf(toString(events.properties.bar), '')), NULL, if(and(in(ascii(toString(events.properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.bar), '[]'), '{}'), toString(events.properties.bar)))), 'foo'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.bar, 'Nullable(String)'), 'foo'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3414,7 +3474,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema.4]
@@ -3442,16 +3503,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3470,7 +3531,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema.5]
@@ -3498,16 +3560,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3526,7 +3588,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_multiple_event_filters[new_events_schema]
@@ -3554,16 +3617,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3582,7 +3645,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_event_filters[new_events_schema.1]
@@ -3610,16 +3674,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3638,7 +3702,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_event_filters[new_events_schema]
@@ -3666,16 +3731,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3694,7 +3759,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_mandatory_filters[new_events_schema.1]
@@ -3722,7 +3788,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -3730,13 +3796,13 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -3753,7 +3819,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_mandatory_filters[new_events_schema.2]
@@ -3781,10 +3848,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), in(s.session_id, ['session_id_one']), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_one']))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_one']))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -3803,7 +3870,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_mandatory_filters[new_events_schema.3]
@@ -3831,10 +3899,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), in(s.session_id, ['session_id_two']), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_two']))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_two']))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -3853,7 +3921,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_mandatory_filters[new_events_schema]
@@ -3881,7 +3950,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -3889,13 +3958,13 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -3912,7 +3981,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_person_filters[new_events_schema.1]
@@ -3940,16 +4010,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -3968,7 +4038,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_operand_or_person_filters[new_events_schema]
@@ -3996,16 +4067,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -4024,7 +4095,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_person_id_filter[new_events_schema]
@@ -4052,7 +4124,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -4060,7 +4132,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -4077,7 +4149,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_person_profile_finds_anonymous_distinct_id_sessions[new_events_schema]
@@ -4105,7 +4178,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), or(in(s.distinct_id, ['identified-user']), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -4113,7 +4186,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -4130,7 +4203,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_host_property_test_account_filter[new_events_schema.1]
@@ -4158,16 +4232,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -4185,7 +4259,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_host_property_test_account_filter[new_events_schema]
@@ -4213,10 +4288,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4235,7 +4310,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_property_test_account_filter[new_events_schema.1]
@@ -4263,10 +4339,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4285,7 +4361,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_property_test_account_filter[new_events_schema]
@@ -4313,10 +4390,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4335,7 +4412,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_property_test_account_filter_allowing_denormalized_props[new_events_schema.1]
@@ -4363,10 +4441,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4385,7 +4463,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_event_property_test_account_filter_allowing_denormalized_props[new_events_schema]
@@ -4413,10 +4492,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4435,7 +4514,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_hogql_event_property_test_account_filter[new_events_schema.1]
@@ -4463,10 +4543,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4485,7 +4565,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_hogql_event_property_test_account_filter[new_events_schema]
@@ -4513,10 +4594,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4535,7 +4616,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_hogql_person_property_test_account_filter[new_events_schema.1]
@@ -4563,10 +4645,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4585,7 +4667,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_hogql_person_property_test_account_filter[new_events_schema]
@@ -4613,10 +4696,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4635,7 +4718,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_person_property_test_account_filter[new_events_schema.1]
@@ -4663,10 +4747,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4685,7 +4769,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_0.test_top_level_person_property_test_account_filter[new_events_schema]
@@ -4713,10 +4798,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4735,7 +4820,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_action_filter[new_events_schema.1]
@@ -4763,10 +4849,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4785,7 +4871,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_action_filter[new_events_schema.2]
@@ -4813,10 +4900,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4835,7 +4922,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_action_filter[new_events_schema.3]
@@ -4863,10 +4951,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(and(equals(events.event, 'custom-event'), and(equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4885,7 +4973,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_action_filter[new_events_schema]
@@ -4913,10 +5002,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2023-01-01 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2023-01-04 00:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), 'test_action_filter-session-one'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), 'test_action_filter-window-id'), 0))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'custom-event'), and(equals(events.properties.`$browser`, 'Firefox'), equals(events.properties.`$session_id`, 'test_action_filter-session-one'), equals(events.properties.`$window_id`, 'test_action_filter-window-id'))), greaterOrEquals(events.timestamp, toDateTime64('2022-12-31 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -4935,7 +5024,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_all_filters_at_once[new_events_schema]
@@ -4963,7 +5053,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -4971,19 +5061,19 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom-event'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000))))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), and(globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom-event'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000))))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0), greater(duration, 60.0))
ORDER BY start_time DESC,
@@ -5000,7 +5090,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_any_event_filter_with_properties[new_events_schema.1]
@@ -5028,10 +5119,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5050,7 +5141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_any_event_filter_with_properties[new_events_schema.2]
@@ -5078,10 +5170,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Firefox'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5100,7 +5192,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_any_event_filter_with_properties[new_events_schema]
@@ -5128,10 +5221,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-01-21 20:00:00.000000', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5150,7 +5243,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter[new_events_schema.1]
@@ -5178,10 +5272,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5200,7 +5294,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter[new_events_schema]
@@ -5228,10 +5323,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5250,7 +5345,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_has_ttl_applied_too[new_events_schema]
@@ -5278,10 +5374,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5300,7 +5396,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_active_sessions[new_events_schema.1]
@@ -5328,10 +5425,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5350,7 +5447,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_active_sessions[new_events_schema]
@@ -5378,10 +5476,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5400,7 +5498,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_group_filter[new_events_schema.1]
@@ -5428,15 +5527,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5455,7 +5554,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_group_filter[new_events_schema.2]
@@ -5483,15 +5583,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 2))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_2 ON equals(events.properties.`$group_2`, events__group_2.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_2.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_2.properties___name, 'org one'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5510,7 +5610,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_group_filter[new_events_schema]
@@ -5538,15 +5639,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'name'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___name, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(events__group_1.properties___name, 'org one'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(events__group_1.properties___name, 'org one'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5565,7 +5666,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema.1]
@@ -5593,16 +5695,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5621,7 +5723,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema.2]
@@ -5649,16 +5752,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5677,7 +5780,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_event_properties_test_accounts_excluded[new_events_schema]
@@ -5705,10 +5809,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5727,7 +5831,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_person_properties[new_events_schema.1]
@@ -5755,10 +5860,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'something else'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'something else'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5777,7 +5882,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_person_properties[new_events_schema]
@@ -5805,10 +5911,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5827,7 +5933,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_properties[new_events_schema.1]
@@ -5855,10 +5962,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5877,7 +5984,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_hogql_properties[new_events_schema]
@@ -5905,10 +6013,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5927,7 +6035,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_matching_on_session_id[new_events_schema.1]
@@ -5955,10 +6064,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$autocapture'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -5977,7 +6086,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_matching_on_session_id[new_events_schema]
@@ -6005,10 +6115,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6027,7 +6137,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_properties[new_events_schema.1]
@@ -6055,10 +6166,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Firefox'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Firefox')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6077,7 +6188,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_properties[new_events_schema.2]
@@ -6105,10 +6217,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6127,7 +6239,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_properties[new_events_schema.3]
@@ -6155,10 +6268,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Safari'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'a_different_event'), equals(events.properties.`$browser`, 'Safari')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6177,7 +6290,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_properties[new_events_schema]
@@ -6205,10 +6319,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), equals(events.properties.`$browser`, 'Chrome')), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6227,7 +6341,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_test_accounts_excluded[new_events_schema.1]
@@ -6255,10 +6370,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6277,7 +6392,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_test_accounts_excluded[new_events_schema]
@@ -6305,28 +6421,28 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.properties.`$browser`, 'Chrome'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0)), 0)
LIMIT 1000000)), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -6344,7 +6460,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_event_filter_with_two_events_and_multiple_teams[new_events_schema]
@@ -6372,16 +6489,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageleave'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageleave'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6400,7 +6517,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_filter_with_person_properties_exact[new_events_schema]
@@ -6428,10 +6546,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -6450,7 +6568,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_filter_with_person_properties_not_contains[new_events_schema]
@@ -6478,10 +6597,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%gmail.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%gmail.com%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -6499,7 +6618,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema.1]
@@ -6527,16 +6647,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6555,7 +6675,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema.2]
@@ -6583,16 +6704,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event2'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6611,7 +6732,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema.3]
@@ -6639,16 +6761,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bar)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^bar)), if(isNull(nullIf(toString(events.properties.bar), '')), NULL, if(and(in(ascii(toString(events.properties.bar)), tuple(91, 123)), in(ascii(toJSONString(events.properties.bar)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.bar), '[]'), '{}'), toString(events.properties.bar)))), 'foo'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.bar, 'Nullable(String)'), 'foo'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6667,7 +6789,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema.4]
@@ -6695,16 +6818,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6723,7 +6846,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema.5]
@@ -6751,16 +6875,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^foo)), if(isNull(nullIf(toString(events.properties.foo), '')), NULL, if(and(in(ascii(toString(events.properties.foo)), tuple(91, 123)), in(ascii(toJSONString(events.properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.foo), '[]'), '{}'), toString(events.properties.foo)))), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, 'new-event'), ifNull(equals(CAST(events.properties.foo, 'Nullable(String)'), 'bar'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6779,7 +6903,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_multiple_event_filters[new_events_schema]
@@ -6807,16 +6932,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'new-event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6835,7 +6960,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_event_filters[new_events_schema.1]
@@ -6863,16 +6989,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6891,7 +7017,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_event_filters[new_events_schema]
@@ -6919,16 +7046,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -6947,7 +7074,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_mandatory_filters[new_events_schema.1]
@@ -6975,7 +7103,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -6983,13 +7111,13 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -7006,7 +7134,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_mandatory_filters[new_events_schema.2]
@@ -7034,10 +7163,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), in(s.session_id, ['session_id_one']), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_one']))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_one']))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7056,7 +7185,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_mandatory_filters[new_events_schema.3]
@@ -7084,10 +7214,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), in(s.session_id, ['session_id_two']), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_two']))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), ['session_id_two']))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7106,7 +7236,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_mandatory_filters[new_events_schema]
@@ -7134,7 +7265,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -7142,13 +7273,13 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING 1
- LIMIT 1000000)))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING 1
+ LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -7165,7 +7296,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_person_filters[new_events_schema.1]
@@ -7193,16 +7325,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -7221,7 +7353,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_operand_or_person_filters[new_events_schema]
@@ -7249,16 +7382,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -7277,7 +7410,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_person_id_filter[new_events_schema]
@@ -7305,7 +7439,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -7313,7 +7447,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -7330,7 +7464,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_person_profile_finds_anonymous_distinct_id_sessions[new_events_schema]
@@ -7358,7 +7493,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), or(in(s.distinct_id, ['identified-user']), globalIn(s.session_id,
- (SELECT DISTINCT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
+ (SELECT DISTINCT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS `$session_id`
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -7366,7 +7501,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), equals(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), '00000000-0000-0000-0000-000000000000'), lessOrEquals(events.timestamp, toDateTime64(toDateTime64('today', 6, 'UTC'), 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))))))), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
ORDER BY start_time DESC,
@@ -7383,7 +7518,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_host_property_test_account_filter[new_events_schema.1]
@@ -7411,16 +7547,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(match(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '^(localhost|127\\.0\\.0\\.1)($|:)'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -7438,7 +7574,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_host_property_test_account_filter[new_events_schema]
@@ -7466,10 +7603,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7488,7 +7625,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_property_test_account_filter[new_events_schema.1]
@@ -7516,10 +7654,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7538,7 +7676,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_property_test_account_filter[new_events_schema]
@@ -7566,10 +7705,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7588,7 +7727,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_property_test_account_filter_allowing_denormalized_props[new_events_schema.1]
@@ -7616,10 +7756,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'false'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7638,7 +7778,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_event_property_test_account_filter_allowing_denormalized_props[new_events_schema]
@@ -7666,10 +7807,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7688,7 +7829,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_hogql_event_property_test_account_filter[new_events_schema.1]
@@ -7716,10 +7858,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^is_internal_user)), if(isNull(nullIf(toString(events.properties.is_internal_user), '')), NULL, if(and(in(ascii(toString(events.properties.is_internal_user)), tuple(91, 123)), in(ascii(toJSONString(events.properties.is_internal_user)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.is_internal_user), '[]'), '{}'), toString(events.properties.is_internal_user)))), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.properties.is_internal_user, 'Nullable(String)'), 'true'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7738,7 +7880,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_hogql_event_property_test_account_filter[new_events_schema]
@@ -7766,10 +7909,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7788,7 +7931,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_hogql_person_property_test_account_filter[new_events_schema.1]
@@ -7816,10 +7960,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7838,7 +7982,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_hogql_person_property_test_account_filter[new_events_schema]
@@ -7866,10 +8011,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7888,7 +8033,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_person_property_test_account_filter[new_events_schema.1]
@@ -7916,10 +8062,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7938,7 +8084,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListFromQuery_1.test_top_level_person_property_test_account_filter[new_events_schema]
@@ -7966,10 +8113,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-01-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-01-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -7988,6 +8135,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_operands_queries.new_events_schema.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_operands_queries.new_events_schema.ambr
index 6aad2575eace..080ff442d73c 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_operands_queries.new_events_schema.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_operands_queries.new_events_schema.ambr
@@ -24,16 +24,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -52,7 +52,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListOperandsQueries.test_multiple_event_filters_or_ed[new_events_schema]
@@ -80,16 +81,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -108,7 +109,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListOperandsQueries.test_positive_and_negative_anded[new_events_schema]
@@ -136,22 +138,22 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0)
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0)
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0)
LIMIT 1000000))))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -169,7 +171,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListOperandsQueries.test_two_negative_ORed[new_events_schema]
@@ -197,16 +200,16 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), or(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notEquals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000))))
GROUP BY s.session_id
@@ -225,7 +228,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListOperandsQueries.test_two_negative_anded[new_events_schema]
@@ -253,22 +257,22 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), or(ifNull(equals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 0), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING and(equals(countIf(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), 0), equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notEquals(CAST(events.properties.vip, 'Nullable(String)'), 'true'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING and(equals(countIf(ifNull(equals(if(notEquals(toJSONString(events.properties.^vip), '{}'), toJSONString(events.properties.^vip), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), 0), equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0))
LIMIT 1000000)), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
- HAVING and(equals(countIf(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^vip)), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), 0), equals(countIf(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), and(equals(events.event, '$pageview'), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 1)), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ HAVING and(equals(countIf(ifNull(equals(if(notEquals(toJSONString(events.properties.^vip), '{}'), toJSONString(events.properties.^vip), if(isNull(nullIf(toString(events.properties.vip), '')), NULL, if(and(in(ascii(toString(events.properties.vip)), tuple(91, 123)), in(ascii(toJSONString(events.properties.vip)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.vip), '[]'), '{}'), toString(events.properties.vip)))), 'true'), 0)), 0), equals(countIf(ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '%target%'), 0)), 0))
LIMIT 1000000))))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -286,6 +290,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_cohort.new_events_schema.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_cohort.new_events_schema.ambr
index 0e8b83e97c9f..c2a1f3ed5093 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_cohort.new_events_schema.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_cohort.new_events_schema.ambr
@@ -24,10 +24,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-08-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-08-21 20:00:00.000000', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, 'custom_event'), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), in(s.distinct_id,
(SELECT pdi.distinct_id AS distinct_id
@@ -58,7 +58,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByCohort.test_filter_with_events_and_cohorts[new_events_schema]
@@ -86,10 +87,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-08-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-08-21 20:00:00.000000', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), equals(events.event, '$pageview'), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), in(s.distinct_id,
(SELECT pdi.distinct_id AS distinct_id
@@ -120,7 +121,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByCohort.test_not_in_cohort_combined_with_other_filters[new_events_schema]
@@ -148,10 +150,10 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2021-08-18 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('2021-08-21 20:00:00.000000', 6, 'UTC')), and(globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^plan)), if(isNull(nullIf(toString(events.person_properties.plan), '')), NULL, if(and(in(ascii(toString(events.person_properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.plan), '[]'), '{}'), toString(events.person_properties.plan)))), 'premium'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(CAST(events.person_properties.plan, 'Nullable(String)'), 'premium'), 0), greaterOrEquals(events.timestamp, toDateTime64('2021-08-17 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)), in(s.distinct_id,
(SELECT pdi.distinct_id AS distinct_id
@@ -182,7 +184,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByCohort.test_not_in_cohort_with_anonymous_users_in_poe_mode[new_events_schema]
@@ -210,7 +213,7 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalNotIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -218,20 +221,20 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT persons.id AS id
- FROM
- (SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person.properties, 'user_group'), ''), 'null'), '^"|"$', '')), person.version), 1) AS properties___user_group, person.id AS id
- FROM person
- WHERE and(equals(person.team_id, 99999), in(id,
- (SELECT where_optimization.id AS id
- FROM person AS where_optimization
- WHERE and(equals(where_optimization.team_id, 99999), and(multiSearchAny(where_optimization.properties, ['internal']), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(where_optimization.properties, 'user_group'), ''), 'null'), '^"|"$', ''), 'internal'), 0))))))
- GROUP BY person.id
- HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))) AS persons
- WHERE ifNull(equals(persons.properties___user_group, 'internal'), 0)
- ORDER BY persons.id ASC SETTINGS optimize_aggregation_in_order=1, join_algorithm='auto')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT persons.id AS id
+ FROM
+ (SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person.properties, 'user_group'), ''), 'null'), '^"|"$', '')), person.version), 1) AS properties___user_group, person.id AS id
+ FROM person
+ WHERE and(equals(person.team_id, 99999), in(id,
+ (SELECT where_optimization.id AS id
+ FROM person AS where_optimization
+ WHERE and(equals(where_optimization.team_id, 99999), and(multiSearchAny(where_optimization.properties, ['internal']), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(where_optimization.properties, 'user_group'), ''), 'null'), '^"|"$', ''), 'internal'), 0))))))
+ GROUP BY person.id
+ HAVING and(equals(argMax(person.is_deleted, person.version), 0), less(argMax(toTimeZone(person.created_at, 'UTC'), person.version), plus(now64(6, 'UTC'), toIntervalDay(1))))) AS persons
+ WHERE ifNull(equals(persons.properties___user_group, 'internal'), 0)
+ ORDER BY persons.id ASC SETTINGS optimize_aggregation_in_order=1, join_algorithm='auto')), greaterOrEquals(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
LIMIT 1000000)))
GROUP BY s.session_id
HAVING and(greaterOrEquals(expiry_time, toDateTime64('today', 6, 'UTC')), equals(max(s.is_deleted), 0))
@@ -249,6 +252,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_group_properties.new_events_schema.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_group_properties.new_events_schema.ambr
index 66ec73ae7542..a0acd132c8b9 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_group_properties.new_events_schema.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recordings_list_by_group_properties.new_events_schema.ambr
@@ -24,15 +24,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'another'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___another, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___another, 'difference'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___another, 'difference'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -51,7 +51,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByGroupProperties.test_filter_with_group_properties[new_events_schema.2]
@@ -79,15 +80,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'difference'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___difference, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___difference, 'value'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___difference, 'value'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -106,7 +107,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByGroupProperties.test_filter_with_group_properties[new_events_schema.3]
@@ -134,15 +136,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'industry'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___industry, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 0))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_0 ON equals(events.properties.`$group_0`, events__group_0.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___industry, 'finance'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___industry, 'finance'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -161,7 +163,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByGroupProperties.test_filter_with_group_properties[new_events_schema.4]
@@ -189,15 +192,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'industry'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___industry, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 0))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_0 ON equals(events.properties.`$group_0`, events__group_0.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___industry, 'difference'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___industry, 'difference'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -216,7 +219,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByGroupProperties.test_filter_with_group_properties[new_events_schema.5]
@@ -244,15 +248,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'difference'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___difference, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 0))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_0 ON equals(events.properties.`$group_0`, events__group_0.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___difference, 'finance'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_0.properties___difference, 'finance'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -271,7 +275,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordingsListByGroupProperties.test_filter_with_group_properties[new_events_schema]
@@ -299,15 +304,15 @@
coalesce(max(s.surfacing_score), 0.36) AS surfacing_score
FROM session_replay_events AS s
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2019-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
+ (SELECT if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))) AS session_id
FROM events_json AS events
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'another'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___another, groups.group_type_index AS index, groups.group_key AS key
FROM groups
WHERE and(equals(groups.team_id, 99999), equals(index, 1))
GROUP BY groups.group_type_index, groups.group_key) AS events__group_1 ON equals(events.properties.`$group_1`, events__group_1.key)
- WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___another, 'value'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))), lessOrEquals(events.timestamp, toDateTime64(now64(6, 'UTC'), 6, 'UTC')), ifNull(equals(events__group_1.properties___another, 'value'), 0), greaterOrEquals(events.timestamp, toDateTime64('2019-12-28 00:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`))))
HAVING 1
LIMIT 1000000)))
GROUP BY s.session_id
@@ -326,6 +331,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/tasks/test/__snapshots__/test_stop_surveys_reached_target.new_events_schema.ambr b/posthog/tasks/test/__snapshots__/test_stop_surveys_reached_target.new_events_schema.ambr
index 1a5282507dfc..58b5389398cc 100644
--- a/posthog/tasks/test/__snapshots__/test_stop_surveys_reached_target.new_events_schema.ambr
+++ b/posthog/tasks/test/__snapshots__/test_stop_surveys_reached_target.new_events_schema.ambr
@@ -1,10 +1,10 @@
# serializer version: 1
# name: TestStopSurveysReachedTarget.test_stop_surveys_with_enough_responses[new_events_schema.1]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
- count(DISTINCT if(ifNull(notEquals(coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 1), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), toString(events.uuid))) AS unique_responses
+ SELECT if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
+ count(DISTINCT if(ifNull(notEquals(coalesce(if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 1), if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), toString(events.uuid))) AS unique_responses
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'survey sent'), greaterOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), ['00000000-0000-0000-0000-000000000003']))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'survey sent'), greaterOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), ['00000000-0000-0000-0000-000000000003']))
GROUP BY survey_id
LIMIT 1 SETTINGS readonly=2,
max_execution_time=60,
@@ -18,15 +18,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStopSurveysReachedTarget.test_stop_surveys_with_enough_responses[new_events_schema]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
- count(DISTINCT if(ifNull(notEquals(coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 1), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), toString(events.uuid))) AS unique_responses
+ SELECT if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
+ count(DISTINCT if(ifNull(notEquals(coalesce(if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 1), if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), toString(events.uuid))) AS unique_responses
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, 'survey sent'), greaterOrEquals(events.timestamp, toDateTime64('2021-12-29 20:00:00.000000', 6, 'UTC')), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), ['00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000002']))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, 'survey sent'), greaterOrEquals(events.timestamp, toDateTime64('2021-12-29 20:00:00.000000', 6, 'UTC')), in(if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), ['00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000002']))
GROUP BY survey_id
LIMIT 2 SETTINGS readonly=2,
max_execution_time=60,
@@ -40,6 +41,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr b/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr
index 279a7246382c..37221ac0c228 100644
--- a/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr
+++ b/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr
@@ -3,31 +3,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 20:00:00'
AND timestamp < '2022-01-10 22:00:00'
@@ -35,31 +35,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -68,31 +68,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 22:00:00'
AND timestamp < '2022-01-10 23:59:59'
@@ -100,31 +100,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -133,24 +133,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 00:00:00'
AND timestamp < '2022-01-10 02:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -160,24 +160,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 02:00:00'
AND timestamp < '2022-01-10 04:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -187,24 +187,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 04:00:00'
AND timestamp < '2022-01-10 06:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -214,24 +214,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 06:00:00'
AND timestamp < '2022-01-10 08:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -241,24 +241,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 08:00:00'
AND timestamp < '2022-01-10 10:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -268,24 +268,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 10:00:00'
AND timestamp < '2022-01-10 12:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -295,24 +295,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 12:00:00'
AND timestamp < '2022-01-10 14:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -322,24 +322,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 14:00:00'
AND timestamp < '2022-01-10 16:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -349,31 +349,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 02:00:00'
AND timestamp < '2022-01-10 04:00:00'
@@ -381,31 +381,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -414,24 +414,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 16:00:00'
AND timestamp < '2022-01-10 18:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -441,24 +441,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 18:00:00'
AND timestamp < '2022-01-10 20:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -468,24 +468,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 20:00:00'
AND timestamp < '2022-01-10 22:00:00'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -495,24 +495,24 @@
'''
SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') AS sdk_lib,
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') AS ai_lib,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 22:00:00'
AND timestamp < '2022-01-10 23:59:59'
AND startsWith(event, '$ai_')
- WHERE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
- 'posthog-python',
- 'posthog-dotnet',
- 'posthog-aspnetcore')
- AND ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_lib`), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
- 'posthog-opencode',
- '@posthog/pi',
- 'posthog-ai')
+ WHERE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('posthog-node',
+ 'posthog-python',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore')
+ AND ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_lib`), '\\/', '/'), toJSONString(properties.^`$ai_lib`)), if(ascii(toString(properties.`$ai_lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_lib`), '\\/', '/'), toJSONString(properties.`$ai_lib`)), '[]'), '{}'), toString(properties.`$ai_lib`))), '') IN ('posthog-openclaw',
+ 'posthog-opencode',
+ '@posthog/pi',
+ 'posthog-ai')
GROUP BY team_id,
sdk_lib,
ai_lib
@@ -522,20 +522,20 @@
'''
SELECT team_id,
- multiIf(ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'node', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python', 'unknown') AS library,
+ multiIf(ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'node', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python', 'unknown') AS library,
count(1) as total
FROM events_json
WHERE event = '$exception'
@@ -614,31 +614,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 04:00:00'
AND timestamp < '2022-01-10 06:00:00'
@@ -646,31 +646,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -815,31 +815,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 06:00:00'
AND timestamp < '2022-01-10 08:00:00'
@@ -847,31 +847,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1031,31 +1031,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 08:00:00'
AND timestamp < '2022-01-10 10:00:00'
@@ -1063,31 +1063,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1096,15 +1096,15 @@
'''
SELECT distinct_id as team,
- sum(toInt64OrZero(ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^count)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^count)), if(ascii(toString(properties.count)) IN (91, 123)
- AND ascii(toJSONString(properties.count)) IN (91, 123), nullIf(nullIf(toJSONString(properties.count), '[]'), '{}'), toString(properties.count))), ''))) as sum
+ sum(toInt64OrZero(ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^count), '\\/', '/'), toJSONString(properties.^count)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^count), '\\/', '/'), toJSONString(properties.^count)), if(ascii(toString(properties.count)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.count), '\\/', '/'), toJSONString(properties.count))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.count), '\\/', '/'), toJSONString(properties.count)), '[]'), '{}'), toString(properties.count))), ''))) as sum
FROM events_json
WHERE team_id = 99999
AND event='decide usage'
AND timestamp >= '2022-01-10 00:00:00'
AND timestamp < '2022-01-10 23:59:59'
- AND has(['correct'], ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^token)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^token)), if(ascii(toString(properties.token)) IN (91, 123)
- AND ascii(toJSONString(properties.token)) IN (91, 123), nullIf(nullIf(toJSONString(properties.token), '[]'), '{}'), toString(properties.token))), ''))
+ AND has(['correct'], ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^token), '\\/', '/'), toJSONString(properties.^token)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^token), '\\/', '/'), toJSONString(properties.^token)), if(ascii(toString(properties.token)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.token), '\\/', '/'), toJSONString(properties.token))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.token), '\\/', '/'), toJSONString(properties.token)), '[]'), '{}'), toString(properties.token))), ''))
GROUP BY team
'''
# ---
@@ -1112,15 +1112,15 @@
'''
SELECT distinct_id as team,
- sum(toInt64OrZero(ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^count)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^count)), if(ascii(toString(properties.count)) IN (91, 123)
- AND ascii(toJSONString(properties.count)) IN (91, 123), nullIf(nullIf(toJSONString(properties.count), '[]'), '{}'), toString(properties.count))), ''))) as sum
+ sum(toInt64OrZero(ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^count), '\\/', '/'), toJSONString(properties.^count)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^count), '\\/', '/'), toJSONString(properties.^count)), if(ascii(toString(properties.count)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.count), '\\/', '/'), toJSONString(properties.count))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.count), '\\/', '/'), toJSONString(properties.count)), '[]'), '{}'), toString(properties.count))), ''))) as sum
FROM events_json
WHERE team_id = 99999
AND event='local evaluation usage'
AND timestamp >= '2022-01-10 00:00:00'
AND timestamp < '2022-01-10 23:59:59'
- AND has(['correct'], ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^token)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^token)), if(ascii(toString(properties.token)) IN (91, 123)
- AND ascii(toJSONString(properties.token)) IN (91, 123), nullIf(nullIf(toJSONString(properties.token), '[]'), '{}'), toString(properties.token))), ''))
+ AND has(['correct'], ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^token), '\\/', '/'), toJSONString(properties.^token)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^token), '\\/', '/'), toJSONString(properties.^token)), if(ascii(toString(properties.token)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.token), '\\/', '/'), toJSONString(properties.token))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.token), '\\/', '/'), toJSONString(properties.token)), '[]'), '{}'), toString(properties.token))), ''))
GROUP BY team
'''
# ---
@@ -1140,13 +1140,13 @@
AND timestamp < '2022-01-10 23:59:59'
AND event = 'survey sent'
GROUP BY team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_id`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_id`)), if(ascii(toString(properties.`$survey_id`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$survey_id`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$survey_id`), '[]'), '{}'), toString(properties.`$survey_id`))), ''),
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_id`), '\\/', '/'), toJSONString(properties.^`$survey_id`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_id`), '\\/', '/'), toJSONString(properties.^`$survey_id`)), if(ascii(toString(properties.`$survey_id`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_id`), '\\/', '/'), toJSONString(properties.`$survey_id`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_id`), '\\/', '/'), toJSONString(properties.`$survey_id`)), '[]'), '{}'), toString(properties.`$survey_id`))), ''),
CASE
- WHEN COALESCE(ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_submission_id`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_submission_id`)), if(ascii(toString(properties.`$survey_submission_id`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$survey_submission_id`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$survey_submission_id`), '[]'), '{}'), toString(properties.`$survey_submission_id`))), ''), '') = '' THEN toString(uuid)
- ELSE ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_submission_id`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$survey_submission_id`)), if(ascii(toString(properties.`$survey_submission_id`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$survey_submission_id`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$survey_submission_id`), '[]'), '{}'), toString(properties.`$survey_submission_id`))), '')
+ WHEN COALESCE(ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_submission_id`), '\\/', '/'), toJSONString(properties.^`$survey_submission_id`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_submission_id`), '\\/', '/'), toJSONString(properties.^`$survey_submission_id`)), if(ascii(toString(properties.`$survey_submission_id`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_submission_id`), '\\/', '/'), toJSONString(properties.`$survey_submission_id`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_submission_id`), '\\/', '/'), toJSONString(properties.`$survey_submission_id`)), '[]'), '{}'), toString(properties.`$survey_submission_id`))), ''), '') = '' THEN toString(uuid)
+ ELSE ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_submission_id`), '\\/', '/'), toJSONString(properties.^`$survey_submission_id`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$survey_submission_id`), '\\/', '/'), toJSONString(properties.^`$survey_submission_id`)), if(ascii(toString(properties.`$survey_submission_id`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_submission_id`), '\\/', '/'), toJSONString(properties.`$survey_submission_id`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$survey_submission_id`), '\\/', '/'), toJSONString(properties.`$survey_submission_id`)), '[]'), '{}'), toString(properties.`$survey_submission_id`))), '')
END)
GROUP BY team_id
'''
@@ -1161,14 +1161,14 @@
max(relay) AS has_verified_relay
FROM
(SELECT team_id,
- ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_verified`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_verified`)), if(ascii(toString(properties.`$ai_gateway_verified`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_gateway_verified`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_gateway_verified`), '[]'), '{}'), toString(properties.`$ai_gateway_verified`))), '') IN ('true',
- '1') AS verified,
- if(verified, ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_request_id`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_request_id`)), if(ascii(toString(properties.`$ai_gateway_request_id`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_gateway_request_id`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_gateway_request_id`), '[]'), '{}'), toString(properties.`$ai_gateway_request_id`))), ''), '') AS request_id,
- if(verified, ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_relay`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$ai_gateway_relay`)), if(ascii(toString(properties.`$ai_gateway_relay`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$ai_gateway_relay`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$ai_gateway_relay`), '[]'), '{}'), toString(properties.`$ai_gateway_relay`))), ''), '') IN ('true',
- '1') AS relay
+ ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_verified`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_verified`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_verified`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_verified`)), if(ascii(toString(properties.`$ai_gateway_verified`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_verified`), '\\/', '/'), toJSONString(properties.`$ai_gateway_verified`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_verified`), '\\/', '/'), toJSONString(properties.`$ai_gateway_verified`)), '[]'), '{}'), toString(properties.`$ai_gateway_verified`))), '') IN ('true',
+ '1') AS verified,
+ if(verified, ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_request_id`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_request_id`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_request_id`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_request_id`)), if(ascii(toString(properties.`$ai_gateway_request_id`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_request_id`), '\\/', '/'), toJSONString(properties.`$ai_gateway_request_id`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_request_id`), '\\/', '/'), toJSONString(properties.`$ai_gateway_request_id`)), '[]'), '{}'), toString(properties.`$ai_gateway_request_id`))), ''), '') AS request_id,
+ if(verified, ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_relay`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_relay`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$ai_gateway_relay`), '\\/', '/'), toJSONString(properties.^`$ai_gateway_relay`)), if(ascii(toString(properties.`$ai_gateway_relay`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_relay`), '\\/', '/'), toJSONString(properties.`$ai_gateway_relay`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$ai_gateway_relay`), '\\/', '/'), toJSONString(properties.`$ai_gateway_relay`)), '[]'), '{}'), toString(properties.`$ai_gateway_relay`))), ''), '') IN ('true',
+ '1') AS relay
FROM events_json
WHERE startsWith(event, '$ai_')
AND timestamp >= '2022-01-10 00:00:00'
@@ -1197,31 +1197,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 10:00:00'
AND timestamp < '2022-01-10 12:00:00'
@@ -1229,31 +1229,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1262,31 +1262,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 12:00:00'
AND timestamp < '2022-01-10 14:00:00'
@@ -1294,31 +1294,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1327,31 +1327,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 14:00:00'
AND timestamp < '2022-01-10 16:00:00'
@@ -1359,31 +1359,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1392,31 +1392,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 16:00:00'
AND timestamp < '2022-01-10 18:00:00'
@@ -1424,31 +1424,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1457,31 +1457,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 18:00:00'
AND timestamp < '2022-01-10 20:00:00'
@@ -1489,31 +1489,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
@@ -1522,31 +1522,31 @@
'''
SELECT team_id,
- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'web', 'web_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'js', 'web_lite_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node', 'node_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-edge', 'edge_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-convex', 'convex_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-android', 'android_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-kmp', 'kmp_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-flutter', 'flutter_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ios', 'ios_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-go', 'go_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-java', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-server', 'java_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-react-native', 'react_native_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-ruby', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rails', 'ruby_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-python', 'python_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-php', 'php_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-dotnet', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-elixir', 'elixir_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-unity', 'unity_events', ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') = 'posthog-rs', 'rust_events', 'other') AS metric,
count(1) as count
FROM events_json PREWHERE timestamp >= '2022-01-10 00:00:00'
AND timestamp < '2022-01-10 02:00:00'
@@ -1554,31 +1554,31 @@
OR event LIKE 'langfuse%'
OR event LIKE 'keywords_ai%'
OR event LIKE 'traceloop%'
- OR ifNull(if(JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)) != '{}', JSONStripEmptyStringsAndNulls(toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
- AND ascii(toJSONString(properties.`$lib`)) IN (91, 123), nullIf(nullIf(toJSONString(properties.`$lib`), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
- 'js',
- 'posthog-node',
- 'posthog-node-mcp',
- 'posthog-python-mcp',
- 'posthog-edge',
- 'posthog-convex',
- 'posthog-android',
- 'posthog-kmp',
- 'posthog-flutter',
- 'posthog-ios',
- 'posthog-go',
- 'posthog-java',
- 'posthog-server',
- 'posthog-react-native',
- 'posthog-ruby',
- 'posthog-rails',
- 'posthog-python',
- 'posthog-php',
- 'posthog-dotnet',
- 'posthog-aspnetcore',
- 'posthog-elixir',
- 'posthog-unity',
- 'posthog-rs'))
+ OR ifNull(if(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)) != '{}', if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.^`$lib`), '\\/', '/'), toJSONString(properties.^`$lib`)), if(ascii(toString(properties.`$lib`)) IN (91, 123)
+ AND ascii(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`))) IN (91, 123), nullIf(nullIf(if(getSetting('output_format_json_escape_forward_slashes'), replaceAll(toJSONString(properties.`$lib`), '\\/', '/'), toJSONString(properties.`$lib`)), '[]'), '{}'), toString(properties.`$lib`))), '') IN ('web',
+ 'js',
+ 'posthog-node',
+ 'posthog-node-mcp',
+ 'posthog-python-mcp',
+ 'posthog-edge',
+ 'posthog-convex',
+ 'posthog-android',
+ 'posthog-kmp',
+ 'posthog-flutter',
+ 'posthog-ios',
+ 'posthog-go',
+ 'posthog-java',
+ 'posthog-server',
+ 'posthog-react-native',
+ 'posthog-ruby',
+ 'posthog-rails',
+ 'posthog-python',
+ 'posthog-php',
+ 'posthog-dotnet',
+ 'posthog-aspnetcore',
+ 'posthog-elixir',
+ 'posthog-unity',
+ 'posthog-rs'))
GROUP BY team_id,
metric
'''
diff --git a/products/ai_observability/backend/api/test/__snapshots__/test_personal_spend.new_events_schema.ambr b/products/ai_observability/backend/api/test/__snapshots__/test_personal_spend.new_events_schema.ambr
index 4f837a6496c7..9bc31bb700fb 100644
--- a/products/ai_observability/backend/api/test/__snapshots__/test_personal_spend.new_events_schema.ambr
+++ b/products/ai_observability/backend/api/test/__snapshots__/test_personal_spend.new_events_schema.ambr
@@ -2,12 +2,12 @@
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.1]
'''
/* user_id:0 request:_snapshot_@me_spend_ */
- SELECT nullIf(arrayJoin(splitByChar(',', coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_tools_called`)), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`)))), ''))), '') AS tool,
+ SELECT nullIf(arrayJoin(splitByChar(',', coalesce(if(notEquals(toJSONString(events.properties.^`$ai_tools_called`), '{}'), toJSONString(events.properties.^`$ai_tools_called`), if(isNull(nullIf(toString(events.properties.`$ai_tools_called`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_tools_called`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_tools_called`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_tools_called`), '[]'), '{}'), toString(events.properties.`$ai_tools_called`)))), ''))), '') AS tool,
count() AS generation_count,
round(sum(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64')), 6) AS cost_usd,
round(avg(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64')), 0) AS avg_input_tokens
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), equals(events.event, '$ai_generation'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), equals(events.event, '$ai_generation'), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
GROUP BY tool
ORDER BY cost_usd DESC
LIMIT 51 SETTINGS readonly=2,
@@ -22,17 +22,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.2]
'''
/* user_id:0 request:_snapshot_@me_spend_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))) AS product,
+ SELECT if(notEquals(toJSONString(events.properties.^ai_product), '{}'), toJSONString(events.properties.^ai_product), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))) AS product,
count() AS event_count,
round(sum(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64')), 6) AS cost_usd
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
GROUP BY product
ORDER BY cost_usd DESC
LIMIT 51 SETTINGS readonly=2,
@@ -47,19 +48,20 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.3]
'''
/* user_id:0 request:_snapshot_@me_spend_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`)))) AS model,
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_model`), '{}'), toJSONString(events.properties.^`$ai_model`), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`)))) AS model,
count() AS generation_count,
round(sum(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64')), 6) AS cost_usd,
sum(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64')) AS input_tokens,
sum(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64')) AS output_tokens
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
GROUP BY model
ORDER BY cost_usd DESC
LIMIT 51 SETTINGS readonly=2,
@@ -74,7 +76,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.4]
@@ -86,7 +89,7 @@
sum(accurateCastOrNull(events.properties.`$ai_input_tokens`, 'Float64')) AS input_tokens,
sum(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64')) AS output_tokens
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
GROUP BY day
ORDER BY day ASC
LIMIT 92 SETTINGS readonly=2,
@@ -101,15 +104,16 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.5]
'''
/* user_id:0 request:_snapshot_@me_spend_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`)))) AS model
+ SELECT if(notEquals(toJSONString(events.properties.^`$ai_model`), '{}'), toJSONString(events.properties.^`$ai_model`), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`)))) AS model
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$ai_model`)), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`))))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))), isNotNull(if(notEquals(toJSONString(events.properties.^`$ai_model`), '{}'), toJSONString(events.properties.^`$ai_model`), if(isNull(nullIf(toString(events.properties.`$ai_model`), '')), NULL, if(and(in(ascii(toString(events.properties.`$ai_model`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$ai_model`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$ai_model`), '[]'), '{}'), toString(events.properties.`$ai_model`))))))
GROUP BY model
ORDER BY sum(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64')) DESC, model ASC
LIMIT 6 SETTINGS readonly=2,
@@ -124,7 +128,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema.6]
@@ -137,7 +142,7 @@
sum(accurateCastOrNull(events.properties.`$ai_output_tokens`, 'Float64')) AS output_tokens,
count() AS generation_count
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
GROUP BY day,
model
ORDER BY day ASC, cost_usd DESC,
@@ -154,18 +159,19 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPersonalSpendQueries.test_empty_result_when_no_events[new_events_schema]
'''
/* user_id:0 request:_snapshot_@me_spend_ */
- SELECT countIf(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0)) AS scoped_event_count,
- round(sumIf(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^ai_product)), if(isNull(nullIf(toString(events.properties.ai_product), '')), NULL, if(and(in(ascii(toString(events.properties.ai_product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.ai_product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.ai_product), '[]'), '{}'), toString(events.properties.ai_product)))), 'posthog_code'), 0)), 6) AS scoped_cost_usd,
+ SELECT countIf(ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0)) AS scoped_event_count,
+ round(sumIf(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64'), ifNull(equals(CAST(events.properties.ai_product, 'Nullable(String)'), 'posthog_code'), 0)), 6) AS scoped_cost_usd,
count() AS event_count,
round(sum(accurateCastOrNull(events.properties.`$ai_total_cost_usd`, 'Float64')), 6) AS total_cost_usd
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('$ai_generation', '$ai_embedding')), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0), and(greaterOrEquals(events.timestamp, toDateTime64('2025-12-16 12:00:00.000000', 6, 'UTC')), less(events.timestamp, toDateTime64('today', 6, 'UTC'))))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -178,6 +184,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/batch_exports/backend/temporal/sql/events.py b/products/batch_exports/backend/temporal/sql/events.py
index 4806aa3d9187..60230b6de0b8 100644
--- a/products/batch_exports/backend/temporal/sql/events.py
+++ b/products/batch_exports/backend/temporal/sql/events.py
@@ -2,7 +2,7 @@
from string import Template
-from posthog.hogql.printer.events_json_document import event_document_sql
+from posthog.hogql.printer.events_json_document import event_document_sql, person_document_sql
# Projected columns a HogQL query can select.
# NOTE: this is just for the 'old' version of our HogQL support, where a user can define a custom
@@ -513,19 +513,22 @@ _PROPERTIES_DOCUMENT = (
.replace("{", "{{")
.replace("}", "}}")
)
+_PERSON_PROPERTIES_DOCUMENT = person_document_sql("person_properties").replace("{", "{{").replace("}", "}}")
SERIALIZED_EVENTS_JSON_SOURCE = """(
SELECT * REPLACE (
toString(uuid) AS uuid,
toString(person_id) AS person_id,
- JSONStripEmptyStringsAndNulls(__PROPERTIES_DOCUMENT__) AS properties,
- JSONStripEmptyStringsAndNulls(toJSONString(person_properties)) AS person_properties
+ __PROPERTIES_DOCUMENT__ AS properties,
+ __PERSON_PROPERTIES_DOCUMENT__ AS person_properties
),
nullIf(toJSONString(temporary_properties.^`$set`), '{{}}') AS set,
nullIf(toJSONString(temporary_properties.^`$set_once`), '{{}}') AS set_once,
nullIf(toJSONString(temporary_properties.^`$unset`), '[]') AS unset,
nullIf(toJSONString(temporary_properties.^`$group_set`), '{{}}') AS group_set
FROM events_json
-)""".replace("__PROPERTIES_DOCUMENT__", _PROPERTIES_DOCUMENT)
+)""".replace("__PROPERTIES_DOCUMENT__", _PROPERTIES_DOCUMENT).replace(
+ "__PERSON_PROPERTIES_DOCUMENT__", _PERSON_PROPERTIES_DOCUMENT
+)
def native_events_export_query(
@@ -556,6 +559,7 @@ SETTINGS
max_replica_delay_for_distributed_queries=60,
fallback_to_stale_replicas_for_distributed_queries=0,
optimize_aggregation_in_order=1,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
{", log_comment={log_comment}" if s3_function else ""}
"""
diff --git a/products/batch_exports/backend/tests/temporal/test_events_sql.py b/products/batch_exports/backend/tests/temporal/test_events_sql.py
index 70715b6d77ac..a08d65d148a4 100644
--- a/products/batch_exports/backend/tests/temporal/test_events_sql.py
+++ b/products/batch_exports/backend/tests/temporal/test_events_sql.py
@@ -1,3 +1,5 @@
+import pytest
+
from posthog.temporal.common.clickhouse import ClickHouseClient
from products.batch_exports.backend.temporal.sql.events import native_events_export_query
@@ -26,6 +28,7 @@ def test_native_events_export_query_keeps_empty_object_literals() -> None:
assert f"temporary_properties.^`{key}`), '{{}}')" in query
-def test_native_events_export_query_unescapes_dotted_keys() -> None:
- # Without this setting `toJSONString(properties)` prints a stored dotted key as `a%2Eb`.
- assert "json_type_escape_dots_in_keys=1" in native_events_export_query("event")
+# Without these settings `toJSONString(properties)` prints a stored dotted key as `a%2Eb` and a `/` as `\/`.
[email protected]("setting", ["json_type_escape_dots_in_keys=1", "output_format_json_escape_forward_slashes=0"])
+def test_native_events_export_query_matches_legacy_json_text(setting: str) -> None:
+ assert setting in native_events_export_query("event")
diff --git a/products/customer_analytics/backend/hogql_queries/test/__snapshots__/test_usage_metrics_query_runner.new_events_schema.ambr b/products/customer_analytics/backend/hogql_queries/test/__snapshots__/test_usage_metrics_query_runner.new_events_schema.ambr
index 3fcf1aec3291..567655c60222 100644
--- a/products/customer_analytics/backend/hogql_queries/test/__snapshots__/test_usage_metrics_query_runner.new_events_schema.ambr
+++ b/products/customer_analytics/backend/hogql_queries/test/__snapshots__/test_usage_metrics_query_runner.new_events_schema.ambr
@@ -2,8 +2,8 @@
# name: TestUsageMetricsQueryRunner.test_complex_event_filter[new_events_schema]
'''
SELECT toStartOfDay(toTimeZone(toTimeZone(events.timestamp, 'UTC'), 'UTC')) AS day,
- accurateCastOrNull(countIf(and(and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('today', 6, 'UTC'))))), 'Float64') AS m0_value,
- accurateCastOrNull(countIf(and(and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), 'Chrome'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))))), 'Float64') AS m0_previous
+ accurateCastOrNull(countIf(and(and(equals(events.properties.`$browser`, 'Chrome'), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('today', 6, 'UTC'))))), 'Float64') AS m0_value,
+ accurateCastOrNull(countIf(and(and(equals(events.properties.`$browser`, 'Chrome'), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))))), 'Float64') AS m0_previous
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -27,7 +27,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_group_metric[new_events_schema.1]
@@ -51,7 +52,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_group_metric[new_events_schema]
@@ -75,7 +77,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_metric_interval[new_events_schema]
@@ -106,7 +109,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_person_metric[new_events_schema.1]
@@ -137,7 +141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_person_metric[new_events_schema]
@@ -168,14 +173,15 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_person_property_filter_splits_a_group_metric_by_user_type[new_events_schema]
'''
SELECT toStartOfDay(toTimeZone(toTimeZone(events.timestamp, 'UTC'), 'UTC')) AS day,
- accurateCastOrNull(countIf(and(and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^user_type)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^user_type)), if(isNull(nullIf(toString(events.person_properties.user_type), '')), NULL, if(and(in(ascii(toString(events.person_properties.user_type)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.user_type)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.user_type), '[]'), '{}'), toString(events.person_properties.user_type)))), 'admin'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-10-02 12:11:00.000000', 6, 'UTC')), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('today', 6, 'UTC'))))), 'Float64') AS m0_value,
- accurateCastOrNull(countIf(and(and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^user_type)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^user_type)), if(isNull(nullIf(toString(events.person_properties.user_type), '')), NULL, if(and(in(ascii(toString(events.person_properties.user_type)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.user_type)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.user_type), '[]'), '{}'), toString(events.person_properties.user_type)))), 'admin'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-09-25 12:11:00.000000', 6, 'UTC')), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-10-02 12:11:00.000000', 6, 'UTC'))))), 'Float64') AS m0_previous
+ accurateCastOrNull(countIf(and(and(ifNull(equals(CAST(events.person_properties.user_type, 'Nullable(String)'), 'admin'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-10-02 12:11:00.000000', 6, 'UTC')), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('today', 6, 'UTC'))))), 'Float64') AS m0_value,
+ accurateCastOrNull(countIf(and(and(ifNull(equals(CAST(events.person_properties.user_type, 'Nullable(String)'), 'admin'), 0), equals(events.event, 'metric_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-09-25 12:11:00.000000', 6, 'UTC')), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2025-10-02 12:11:00.000000', 6, 'UTC'))))), 'Float64') AS m0_previous
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), equals(events.properties.`$group_0`, 'test_group'), greaterOrEquals(events.timestamp, toDateTime64('2025-09-25 12:11:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')))
GROUP BY day
@@ -192,7 +198,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestUsageMetricsQueryRunner.test_sum_math_aggregation[new_events_schema]
@@ -223,6 +230,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_breakdowns_query_runner.new_events_schema.ambr b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_breakdowns_query_runner.new_events_schema.ambr
index 17ffe25b0ceb..713273c1dba2 100644
--- a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_breakdowns_query_runner.new_events_schema.ambr
+++ b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_breakdowns_query_runner.new_events_schema.ambr
@@ -21,7 +21,7 @@
(SELECT tupleElement(breakdown_tuple, 1) AS breakdown_property,
tupleElement(breakdown_tuple, 2) AS breakdown_value
FROM
- (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
+ (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
FROM events_json AS events
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -29,7 +29,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2024-01-03 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), equals(events.event, '$exception'), ifNull(equals(events__fingerprint_issue_state.issue_id, '01936e7f-d7ff-7314-b2d4-7627981e34f0'), 0))))
GROUP BY breakdown_property,
breakdown_value))
@@ -48,7 +48,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingBreakdownsQueryRunner.test_breakdown_with_limit[new_events_schema]
@@ -73,7 +74,7 @@
(SELECT tupleElement(breakdown_tuple, 1) AS breakdown_property,
tupleElement(breakdown_tuple, 2) AS breakdown_value
FROM
- (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
+ (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
FROM events_json AS events
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -81,7 +82,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2024-01-03 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), equals(events.event, '$exception'), ifNull(equals(events__fingerprint_issue_state.issue_id, '01936e7f-d7ff-7314-b2d4-7627981e34f0'), 0))))
GROUP BY breakdown_property,
breakdown_value))
@@ -100,7 +101,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingBreakdownsQueryRunner.test_breakdown_with_null_values[new_events_schema]
@@ -125,7 +127,7 @@
(SELECT tupleElement(breakdown_tuple, 1) AS breakdown_property,
tupleElement(breakdown_tuple, 2) AS breakdown_value
FROM
- (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
+ (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
FROM events_json AS events
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -133,7 +135,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2024-01-03 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), equals(events.event, '$exception'), ifNull(equals(events__fingerprint_issue_state.issue_id, '01936e7f-d7ff-7314-b2d4-7627981e34f0'), 0))))
GROUP BY breakdown_property,
breakdown_value))
@@ -152,7 +154,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingBreakdownsQueryRunner.test_multiple_breakdown_properties[new_events_schema]
@@ -177,7 +180,7 @@
(SELECT tupleElement(breakdown_tuple, 1) AS breakdown_property,
tupleElement(breakdown_tuple, 2) AS breakdown_value
FROM
- (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$')), tuple('$os', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$os`)), if(isNull(nullIf(toString(events.properties.`$os`), '')), NULL, if(and(in(ascii(toString(events.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$os`), '[]'), '{}'), toString(events.properties.`$os`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
+ (SELECT arrayJoin([tuple('$browser', ifNull(toString(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`))))), '$$_posthog_breakdown_null_$$')), tuple('$os', ifNull(toString(if(notEquals(toJSONString(events.properties.^`$os`), '{}'), toJSONString(events.properties.^`$os`), if(isNull(nullIf(toString(events.properties.`$os`), '')), NULL, if(and(in(ascii(toString(events.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$os`), '[]'), '{}'), toString(events.properties.`$os`))))), '$$_posthog_breakdown_null_$$'))]) AS breakdown_tuple
FROM events_json AS events
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -185,7 +188,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greaterOrEquals(events.timestamp, toDateTime64('2024-01-03 00:00:00.000000', 6, 'UTC')), lessOrEquals(events.timestamp, toDateTime64('today', 6, 'UTC')), equals(events.event, '$exception'), ifNull(equals(events__fingerprint_issue_state.issue_id, '01936e7f-d7ff-7314-b2d4-7627981e34f0'), 0))))
GROUP BY breakdown_property,
breakdown_value))
@@ -204,6 +207,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_issue_correlation_query_runner.new_events_schema.ambr b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_issue_correlation_query_runner.new_events_schema.ambr
index 0fd771148523..0c169b15b1a4 100644
--- a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_issue_correlation_query_runner.new_events_schema.ambr
+++ b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_issue_correlation_query_runner.new_events_schema.ambr
@@ -8,7 +8,7 @@
FROM
(SELECT events__fingerprint_issue_state.issue_id AS issue_id,
max(toTimeZone(events.timestamp, 'UTC')) AS last_seen,
- argMax(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$lib`)), if(isNull(nullIf(toString(events.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(events.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$lib`), '[]'), '{}'), toString(events.properties.`$lib`)))), toTimeZone(events.timestamp, 'UTC')) AS library
+ argMax(if(notEquals(toJSONString(events.properties.^`$lib`), '{}'), toJSONString(events.properties.^`$lib`), if(isNull(nullIf(toString(events.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(events.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$lib`), '[]'), '{}'), toString(events.properties.`$lib`)))), toTimeZone(events.timestamp, 'UTC')) AS library
FROM events_json AS events
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -16,7 +16,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greater(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalHour(6)), 6, 'UTC')), notEmpty(events.properties.`$session_id`), isNotNull(events__fingerprint_issue_state.issue_id), equals(events.event, '$exception'))
GROUP BY events__fingerprint_issue_state.issue_id))
SELECT event AS event,
@@ -56,7 +56,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
WHERE and(equals(events.team_id, 99999), greater(events.timestamp, toDateTime64(minus(now64(6, 'UTC'), toIntervalHour(6)), 6, 'UTC')), notEmpty(events.properties.`$session_id`))
GROUP BY events.properties.`$session_id`) ARRAY
JOIN events AS event,
@@ -75,6 +75,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_query_runner.new_events_schema.ambr b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_query_runner.new_events_schema.ambr
index 28624710cd0e..fbfc426ef0ca 100644
--- a/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_query_runner.new_events_schema.ambr
+++ b/products/error_tracking/backend/hogql_queries/test/__snapshots__/test_error_tracking_query_runner.new_events_schema.ambr
@@ -19,17 +19,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -62,7 +62,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_correctly_counts_session_ids[new_events_schema]
@@ -85,17 +86,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -128,7 +129,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_empty_search_query[new_events_schema]
@@ -146,13 +148,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), and(or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['probs']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['probs']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['not']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['not']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['found']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['found']), 0), 0))))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), and(or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['probs']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['probs']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['probs']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['not']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['not']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['not']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['found']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['found']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['found']), 0), 0))))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -184,7 +186,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_first_seen_filters[new_events_schema.1]
@@ -200,7 +203,7 @@
min(e__fingerprint_issue_state.first_seen) AS first_seen,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source,
- argMax(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
+ argMax(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
FROM events_json AS e
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -215,7 +218,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(e__fingerprint_issue_state.issue_id), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2016-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), ifNull(less(e__fingerprint_issue_state.first_seen, parseDateTime64BestEffort('2020-01-10T10:11:00+00:00', 6, 'UTC')), 0))
GROUP BY id
ORDER BY last_seen DESC
@@ -232,7 +235,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_first_seen_filters[new_events_schema]
@@ -248,7 +252,7 @@
min(e__fingerprint_issue_state.first_seen) AS first_seen,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source,
- argMax(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
+ argMax(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
FROM events_json AS e
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -263,7 +267,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(e__fingerprint_issue_state.issue_id), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2016-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), ifNull(greaterOrEquals(e__fingerprint_issue_state.first_seen, parseDateTime64BestEffort('2020-01-10T10:11:00+00:00', 6, 'UTC')), 0))
GROUP BY id
ORDER BY last_seen DESC
@@ -280,7 +284,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_group_key_filter[new_events_schema.1]
@@ -298,13 +303,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'org:widgets'))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'org:widgets'))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -336,7 +341,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_group_key_filter[new_events_schema.2]
@@ -354,13 +360,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_1`, 'project:alpha'))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_1`, 'project:alpha'))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -392,7 +398,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_group_key_filter[new_events_schema.3]
@@ -410,13 +417,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'nonexistent'))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'nonexistent'))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -448,7 +455,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_group_key_filter[new_events_schema]
@@ -466,13 +474,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'org:acme'))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(e.properties.`$group_0`, 'org:acme'))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -504,7 +512,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_hogql_filters[new_events_schema]
@@ -522,13 +531,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), '[email protected]'), 0))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), ifNull(equals(CAST(e.person_properties.email, 'Nullable(String)'), '[email protected]'), 0))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -560,7 +569,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_issue_filters[new_events_schema]
@@ -576,7 +586,7 @@
min(e__fingerprint_issue_state.first_seen) AS first_seen,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function,
argMax(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source,
- argMax(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
+ argMax(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library
FROM events_json AS e
LEFT OUTER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -591,7 +601,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), e__fingerprint_issue_state.fp_hash)
WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(e__fingerprint_issue_state.issue_id), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), ifNull(equals(e__fingerprint_issue_state.issue_name, 'TypeError'), 0))
GROUP BY id
ORDER BY last_seen DESC
@@ -608,7 +618,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_issue_grouping[new_events_schema]
@@ -631,17 +642,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -674,7 +685,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_only_returns_exception_events[new_events_schema]
@@ -692,13 +704,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2016-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2016-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -730,7 +742,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_ordering[new_events_schema.1]
@@ -748,13 +761,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -786,7 +799,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_ordering[new_events_schema]
@@ -804,13 +818,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -842,7 +856,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_overrides_aggregation[new_events_schema]
@@ -865,17 +880,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -908,7 +923,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_person_id_filter[new_events_schema]
@@ -926,11 +942,11 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -939,7 +955,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('explicit_redacted_timestamp', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), '00000000-0000-4000-8000-000000000002'))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('explicit_redacted_timestamp', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), equals(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id), '00000000-0000-4000-8000-000000000002'))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -971,7 +987,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_search_person_properties[new_events_schema]
@@ -989,13 +1006,13 @@
argMaxMerge(ev.source_state) AS source,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['[email protected]']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['[email protected]']), 0), 0)))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['[email protected]']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['[email protected]']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['[email protected]']), 0), 0)))
GROUP BY fp_hash) AS ev
INNER JOIN
(SELECT cityHash64(error_tracking_fingerprint_issue_state.fingerprint) AS fp_hash,
@@ -1027,7 +1044,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_search_query[new_events_schema]
@@ -1050,17 +1068,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['databasenot']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['databasenot']), 0), 0)))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), ifNull(notILike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenot']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['databasenot']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['databasenot']), 0), 0)))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -1093,7 +1111,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_search_query_with_multiple_search_items[new_events_schema]
@@ -1116,17 +1135,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 1))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(0, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 1)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), and(or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['databasenotfoundX']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['databasenotfoundX']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^email)), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['clickhouse/client/execute.py']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['clickhouse/client/execute.py']), 0), 0))))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), ifNull(notILike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2018-01-11 12:11:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), and(or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['databasenotfoundX']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['databasenotfoundX']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['databasenotfoundX']), 0), 0)), or(arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_types`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_values`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_sources`, []), 'Array(String)')), arrayExists(v -> ifNull(greater(multiSearchAnyCaseInsensitive(v, ['clickhouse/client/execute.py']), 0), 0), accurateCast(ifNull(e.properties.`$exception_functions`, []), 'Array(String)')), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.properties.^email), '{}'), toJSONString(e.properties.^email), if(isNull(nullIf(toString(e.properties.email), '')), NULL, if(and(in(ascii(toString(e.properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.email), '[]'), '{}'), toString(e.properties.email))))), ['clickhouse/client/execute.py']), 0), 0), ifNull(greater(multiSearchAnyCaseInsensitive(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), ['clickhouse/client/execute.py']), 0), 0))))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -1159,7 +1178,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_volume_aggregation_advanced[new_events_schema]
@@ -1182,17 +1202,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 4))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(3, intDiv(dateDiff('seconds', toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 4)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -1225,7 +1245,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestErrorTrackingQueryRunner.test_volume_aggregation_simple[new_events_schema]
@@ -1248,17 +1269,17 @@
and isNull(i)), ev.occ, toUInt64(0)), range(0, 3))) AS volumeRange,
argMaxMerge(ev.library_state) AS library
FROM
- (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
+ (SELECT cityHash64(JSONExtractString(ifNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'))), ''))) AS fp_hash,
max(toTimeZone(e.timestamp, 'UTC')) AS last_seen_fp,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_functions`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_functions`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_functions`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_functions`[-1]), '[]'), '{}'), toString(e.properties.`$exception_functions`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS function_state,
argMaxState(if(isNull(nullIf(toString(e.properties.`$exception_sources`[-1]), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_sources`[-1])), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_sources`[-1])), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_sources`[-1]), '[]'), '{}'), toString(e.properties.`$exception_sources`[-1]))), toTimeZone(e.timestamp, 'UTC')) AS source_state,
- argMaxState(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$lib`)), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
+ argMaxState(if(notEquals(toJSONString(e.properties.^`$lib`), '{}'), toJSONString(e.properties.^`$lib`), if(isNull(nullIf(toString(e.properties.`$lib`), '')), NULL, if(and(in(ascii(toString(e.properties.`$lib`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$lib`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$lib`), '[]'), '{}'), toString(e.properties.`$lib`)))), toTimeZone(e.timestamp, 'UTC')) AS library_state,
least(2, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2020-01-10 00:00:00.000000', 6, 'UTC'), 'UTC'), toTimeZone(e.timestamp, 'UTC')), greatest(1, intDiv(dateDiff('seconds', toDateTime(toDateTime64('2020-01-10 00:00:00.000000', 6, 'UTC'), 'UTC'), toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')), 3)))) AS bin_idx,
count() AS occ,
uniqState(nullIf(e.properties.`$session_id`, '')) AS sessions_state,
uniqState(coalesce(nullIf(toString(e.person_id), '00000000-0000-0000-0000-000000000000'), e.distinct_id)) AS users_state
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2020-01-10 00:00:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
+ WHERE and(equals(e.team_id, 99999), equals(e.event, '$exception'), isNotNull(if(notEquals(toJSONString(e.properties.^`$exception_fingerprint`), '{}'), toJSONString(e.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(e.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(e.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$exception_fingerprint`), '[]'), '{}'), toString(e.properties.`$exception_fingerprint`))))), greaterOrEquals(e.timestamp, toDateTime(toDateTime64('2020-01-10 00:00:00.000000', 6, 'UTC'), 'UTC')), lessOrEquals(e.timestamp, toDateTime(toDateTime64('today', 6, 'UTC'), 'UTC')))
GROUP BY fp_hash,
bin_idx) AS ev
INNER JOIN
@@ -1291,6 +1312,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel.new_events_schema.ambr
index 539f74a98a2c..fa7065644db1 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel.new_events_schema.ambr
@@ -56,7 +56,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_aggregation_with_groups_across_persons[new_events_schema]
@@ -124,7 +125,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_conversion_window_seconds[new_events_schema.1]
@@ -183,7 +185,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_conversion_window_seconds[new_events_schema]
@@ -258,7 +261,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_events_with_person_on_events_v2[new_events_schema]
@@ -333,7 +337,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_precalculated_cohort_step_filter[new_events_schema]
@@ -403,7 +408,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_property_groups[new_events_schema.1]
@@ -431,8 +437,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'user signed up'), 1, 0) AS step_0,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha.com'), 0)), 1, 0) AS step_1,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha2.com'), 0)), 1, 0) AS step_2
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha.com'), 0)), 1, 0) AS step_1,
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha2.com'), 0)), 1, 0) AS step_2
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -441,7 +447,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -462,7 +468,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_property_groups[new_events_schema.2]
@@ -490,8 +497,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'user signed up'), 1, 0) AS step_0,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha.com'), 0)), 1, 0) AS step_1,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha2.com'), 0)), 1, 0) AS step_2
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha.com'), 0)), 1, 0) AS step_1,
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha2.com'), 0)), 1, 0) AS step_2
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -500,7 +507,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 1)
@@ -521,7 +528,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_property_groups[new_events_schema.3]
@@ -549,8 +557,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'user signed up'), 1, 0) AS step_0,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha.com'), 0)), 1, 0) AS step_1,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha2.com'), 0)), 1, 0) AS step_2
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha.com'), 0)), 1, 0) AS step_1,
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha2.com'), 0)), 1, 0) AS step_2
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -559,7 +567,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 2)
@@ -580,7 +588,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_property_groups[new_events_schema]
@@ -621,8 +630,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'user signed up'), 1, 0) AS step_0,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha.com'), 0)), 1, 0) AS step_1,
- if(and(equals(e.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))), 'aloha2.com'), 0)), 1, 0) AS step_2
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha.com'), 0)), 1, 0) AS step_1,
+ if(and(equals(e.event, '$pageview'), ifNull(equals(CAST(e.properties.`$current_url`, 'Nullable(String)'), 'aloha2.com'), 0)), 1, 0) AS step_2
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -631,7 +640,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^age)), if(isNull(nullIf(toString(e.person_properties.age), '')), NULL, if(and(in(ascii(toString(e.person_properties.age)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.age)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.age), '[]'), '{}'), toString(e.person_properties.age)))), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'user signed up')), or(and(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.com%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '20'), 0)), or(ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%.org%'), 0), ifNull(equals(CAST(e.person_properties.age, 'Nullable(String)'), '28'), 0)))), or(equals(step_0, 1), equals(step_1, 1), equals(step_2, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
GROUP BY breakdown
@@ -655,7 +664,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_funnel_with_static_cohort_step_filter[new_events_schema]
@@ -725,7 +735,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFOSSFunnelUDF.test_timezones[new_events_schema]
@@ -792,7 +803,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownUDF.test_funnel_breakdown_correct_breakdown_props_are_chosen[new_events_schema]
@@ -828,8 +840,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
- if(and(equals(e.event, 'buy'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`)))), 'xyz'), 0)), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ if(and(equals(e.event, 'buy'), ifNull(equals(CAST(e.properties.`$version`, 'Nullable(String)'), 'xyz'), 0)), 1, 0) AS step_1,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -861,7 +873,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownUDF.test_funnel_breakdown_correct_breakdown_props_are_chosen_for_step[new_events_schema]
@@ -897,8 +910,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
- if(and(equals(e.event, 'buy'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`)))), 'xyz'), 0)), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ if(and(equals(e.event, 'buy'), ifNull(equals(CAST(e.properties.`$version`, 'Nullable(String)'), 'xyz'), 0)), 1, 0) AS step_1,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
if(equals(step_1, 1), prop_basic, []) AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -930,7 +943,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownUDF.test_funnel_step_multiple_breakdown_snapshot[new_events_schema]
@@ -967,8 +981,8 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
if(equals(e.event, 'buy'), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
- ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
+ ifNull(toString(if(notEquals(toJSONString(e.properties.^`$version`), '{}'), toJSONString(e.properties.^`$version`), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -1000,7 +1014,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_aggregate_by_groups_breakdown_group_person_on_events[new_events_schema]
@@ -1080,7 +1095,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_breakdown_group[new_events_schema.1]
@@ -1150,7 +1166,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_breakdown_group[new_events_schema.2]
@@ -1220,7 +1237,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_breakdown_group[new_events_schema.3]
@@ -1290,7 +1308,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_breakdown_group[new_events_schema.4]
@@ -1360,7 +1379,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelGroupBreakdownUDF.test_funnel_breakdown_group[new_events_schema]
@@ -1447,6 +1467,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_breakdowns_by_current_url.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_breakdowns_by_current_url.new_events_schema.ambr
index e74803374bbe..cbf165abe2da 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_breakdowns_by_current_url.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_breakdowns_by_current_url.new_events_schema.ambr
@@ -33,7 +33,7 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'watched movie'), 1, 0) AS step_0,
if(equals(e.event, 'terminate funnel'), 1, 0) AS step_1,
- [if(empty(replaceRegexpOne(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), ''), '[\\/?#]*$', '')), '/', replaceRegexpOne(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), ''), '[\\/?#]*$', ''))] AS prop_basic,
+ [if(empty(replaceRegexpOne(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), ''), '[\\/?#]*$', '')), '/', replaceRegexpOne(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), ''), '[\\/?#]*$', ''))] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -65,7 +65,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownsByCurrentURL.test_breakdown_by_pathname[new_events_schema]
@@ -102,7 +103,7 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'watched movie'), 1, 0) AS step_0,
if(equals(e.event, 'terminate funnel'), 1, 0) AS step_1,
- [if(empty(replaceRegexpOne(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '[\\/?#]*$', '')), '/', replaceRegexpOne(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '[\\/?#]*$', ''))] AS prop_basic,
+ [if(empty(replaceRegexpOne(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$pathname`), '{}'), toJSONString(e.properties.^`$pathname`), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '[\\/?#]*$', '')), '/', replaceRegexpOne(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$pathname`), '{}'), toJSONString(e.properties.^`$pathname`), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '[\\/?#]*$', ''))] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -134,7 +135,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownsByCurrentURL.test_breakdown_by_pathname_with_path_cleaning[new_events_schema]
@@ -171,7 +173,7 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'watched movie'), 1, 0) AS step_0,
if(equals(e.event, 'terminate funnel'), 1, 0) AS step_1,
- [if(empty(replaceRegexpOne(replaceRegexpAll(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home'), '[\\/?#]*$', '')), '/', replaceRegexpOne(replaceRegexpAll(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home'), '[\\/?#]*$', ''))] AS prop_basic,
+ [if(empty(replaceRegexpOne(replaceRegexpAll(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$pathname`), '{}'), toJSONString(e.properties.^`$pathname`), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home'), '[\\/?#]*$', '')), '/', replaceRegexpOne(replaceRegexpAll(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$pathname`), '{}'), toJSONString(e.properties.^`$pathname`), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home'), '[\\/?#]*$', ''))] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -203,7 +205,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelBreakdownsByCurrentURL.test_breakdown_by_pathname_with_path_cleaning_without_normalization[new_events_schema]
@@ -240,7 +243,7 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'watched movie'), 1, 0) AS step_0,
if(equals(e.event, 'terminate funnel'), 1, 0) AS step_1,
- [replaceRegexpAll(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$pathname`)), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home')] AS prop_basic,
+ [replaceRegexpAll(ifNull(toString(if(notEquals(toJSONString(e.properties.^`$pathname`), '{}'), toJSONString(e.properties.^`$pathname`), if(isNull(nullIf(toString(e.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(e.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$pathname`), '[]'), '{}'), toString(e.properties.`$pathname`))))), ''), '/home.*', '/cleaned-home')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -272,6 +275,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation.new_events_schema.ambr
index d2f0cc0e2487..da5cc80329cb 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation.new_events_schema.ambr
@@ -6,7 +6,7 @@
FROM
(SELECT arraySort(t -> t.1, groupArray(tuple(accurateCastOrNull(timestamp, 'Float64'), uuid, '', arrayFilter(x -> ifNull(notEquals(x, 0), 1), [multiply(1, step_0), multiply(2, step_1)])))) AS events_array, [''] AS prop, arrayJoin(aggregate_funnel(2, 1209600, 'first_touch', 'ordered', prop, [], arrayFilter((x, x_before, x_after) -> not(and(lessOrEquals(length(x.4), 1), equals(x.4, x_before.4), equals(x.4, x_after.4), equals(x.3, x_before.3), equals(x.3, x_after.3), ifNull(greater(x.1, x_before.1), 0), ifNull(less(x.1, x_after.1), 0))), events_array, arrayRotateRight(events_array, 1), arrayRotateLeft(events_array, 1)))) AS af_tuple, af_tuple.1 AS step_reached, plus(af_tuple.1, 1) AS steps, af_tuple.2 AS breakdown, af_tuple.3 AS timings, af_tuple.4 AS matched_event_uuids_array_array, groupArray(tuple(timestamp, uuid, `$session_id`, `$window_id`)) AS user_events, mapFromArrays(arrayMap(x -> x.2, user_events), user_events) AS user_events_map, arrayMap(matched_event_uuids_array -> arrayMap(event_uuid -> user_events_map[event_uuid], arrayDistinct(matched_event_uuids_array)), matched_event_uuids_array_array) AS matched_events_array, af_tuple.5 AS steps_bitfield, aggregation_target AS aggregation_target
FROM
- (SELECT toTimeZone(e.timestamp, 'UTC') AS timestamp, if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS aggregation_target, e.uuid AS uuid, e.properties.`$session_id` AS `$session_id`, e.properties.`$window_id` AS `$window_id`, if(and(equals(e.event, 'user signed up'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key)))), 'val'), 0)), 1, 0) AS step_0, if(and(equals(e.event, 'paid'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key)))), 'val'), 0)), 1, 0) AS step_1
+ (SELECT toTimeZone(e.timestamp, 'UTC') AS timestamp, if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS aggregation_target, e.uuid AS uuid, e.properties.`$session_id` AS `$session_id`, e.properties.`$window_id` AS `$window_id`, if(and(equals(e.event, 'user signed up'), ifNull(equals(CAST(e.properties.key, 'Nullable(String)'), 'val'), 0)), 1, 0) AS step_0, if(and(equals(e.event, 'paid'), ifNull(equals(CAST(e.properties.key, 'Nullable(String)'), 'val'), 0)), 1, 0) AS step_1
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id
@@ -59,7 +59,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_basic_funnel_correlation_with_properties[new_events_schema.1]
@@ -105,7 +106,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'Positive'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), equals(e.person_properties.`$browser`, 'Positive')), or(equals(step_0, 1), equals(step_1, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -134,7 +135,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_basic_funnel_correlation_with_properties[new_events_schema.2]
@@ -180,7 +182,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'Positive'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), equals(e.person_properties.`$browser`, 'Positive')), or(equals(step_0, 1), equals(step_1, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -209,7 +211,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_basic_funnel_correlation_with_properties[new_events_schema.3]
@@ -255,7 +258,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'Negative'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), equals(e.person_properties.`$browser`, 'Negative')), or(equals(step_0, 1), equals(step_1, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -284,7 +287,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_basic_funnel_correlation_with_properties[new_events_schema.4]
@@ -330,7 +334,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'Negative'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('today', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('paid', 'user signed up')), equals(e.person_properties.`$browser`, 'Negative')), or(equals(step_0, 1), equals(step_1, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -359,7 +363,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_basic_funnel_correlation_with_properties[new_events_schema]
@@ -443,7 +448,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_event_properties_and_groups[new_events_schema]
@@ -484,13 +490,15 @@
ORDER BY aggregation_target ASC SETTINGS join_algorithm='auto'),
filtered_events AS
(SELECT events.event AS event,
- JSONStripEmptyStringsAndNulls(concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
- and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
- and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}')) AS properties,
+ concat('{', arrayStringConcat(arrayConcat(arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), arrayFilter(kv -> not (kv.2 = '[]'
+ and kv.1 in ('$exception_functions', '$exception_list', '$exception_sources', '$exception_types', '$exception_values', '$mcp_listed_tool_names'))
+ and not (kv.2 = '""'
+ and kv.1 in ('$browser', '$browser_language', '$browser_version', '$config_defaults', '$device_type', '$geoip_city_name', '$geoip_continent_code', '$geoip_continent_name', '$geoip_country_code', '$geoip_country_name', '$geoip_subdivision_1_name', '$geoip_time_zone', '$group_0', '$group_1', '$group_2', '$group_3', '$group_4', '$lib', '$lib_version', '$os', '$os_version', '$session_id', '$timezone', '$window_id'))
+ and kv.1 != '$feature_flags', JSONExtractKeysAndValuesRaw(toJSONString(events.properties)))), arrayConcat(arrayMap((key, value) -> concat(toJSONString(concat('$feature/', key)), ':', if(value in ('true', 'false'), value, toJSONString(multiIf(value = '$false', 'false', value = '$true', 'true', value)))), mapKeys(events.properties.`$feature_flags`), mapValues(events.properties.`$feature_flags`)), if(empty(events.properties.`$feature_flags`), [], [concat('"$active_feature_flags":', toJSONString(mapKeys(mapFilter((key, value) -> value not in ('', 'false'), events.properties.`$feature_flags`))))])), arrayMap(kv -> concat(toJSONString(kv.1), ':', kv.2), JSONExtractKeysAndValuesRaw(toJSONString(events.temporary_properties)))), ','), '}') AS properties,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
events.properties.`$group_1` AS `$group_1`,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_issue_id`)), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), 'UUID') AS event_issue_id,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^`$exception_issue_id`), '{}'), toJSONString(events.properties.^`$exception_issue_id`), if(isNull(nullIf(toString(events.properties.`$exception_issue_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_issue_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_issue_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_issue_id`), '[]'), '{}'), toString(events.properties.`$exception_issue_id`)))), 'UUID') AS event_issue_id,
events__fingerprint_issue_state.issue_id AS issue_id,
events__fingerprint_issue_state.issue_id AS issue_id_v2,
events__fingerprint_issue_state.issue_name AS issue_name,
@@ -512,7 +520,7 @@
FROM error_tracking_fingerprint_issue_state
WHERE equals(error_tracking_fingerprint_issue_state.team_id, 99999)
GROUP BY fp_hash
- HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$exception_fingerprint`)), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
+ HAVING equals(argMax(error_tracking_fingerprint_issue_state.is_deleted, error_tracking_fingerprint_issue_state.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__fingerprint_issue_state ON equals(cityHash64(if(notEquals(toJSONString(events.properties.^`$exception_fingerprint`), '{}'), toJSONString(events.properties.^`$exception_fingerprint`), if(isNull(nullIf(toString(events.properties.`$exception_fingerprint`), '')), NULL, if(and(in(ascii(toString(events.properties.`$exception_fingerprint`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$exception_fingerprint`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$exception_fingerprint`), '[]'), '{}'), toString(events.properties.`$exception_fingerprint`))))), events__fingerprint_issue_state.fp_hash)
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
person_distinct_id_overrides.distinct_id AS distinct_id
@@ -548,7 +556,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.1]
@@ -618,7 +627,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.2]
@@ -688,7 +698,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.3]
@@ -758,7 +769,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.4]
@@ -828,7 +840,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.5]
@@ -883,7 +896,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.6]
@@ -953,7 +967,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema.7]
@@ -1023,7 +1038,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_events_and_groups[new_events_schema]
@@ -1073,7 +1089,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema.1]
@@ -1147,7 +1164,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema.2]
@@ -1221,7 +1239,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema.3]
@@ -1295,7 +1314,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema.4]
@@ -1369,7 +1389,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema.5]
@@ -1445,7 +1466,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups[new_events_schema]
@@ -1521,7 +1543,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema.1]
@@ -1595,7 +1618,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema.2]
@@ -1669,7 +1693,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema.3]
@@ -1743,7 +1768,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema.4]
@@ -1817,7 +1843,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema.5]
@@ -1893,7 +1920,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseFunnelCorrelation.test_funnel_correlation_with_properties_and_groups_person_on_events[new_events_schema]
@@ -1969,6 +1997,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation_actors.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation_actors.new_events_schema.ambr
index 1125c86a853e..0e2333b3b528 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation_actors.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_correlation_actors.new_events_schema.ambr
@@ -83,7 +83,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelCorrelationActors.test_funnel_correlation_on_event_with_recordings[new_events_schema]
@@ -169,7 +170,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelCorrelationActors.test_funnel_correlation_on_properties_with_recordings[new_events_schema]
@@ -215,7 +217,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'insight analyzed')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^foo)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^foo)), if(isNull(nullIf(toString(e.person_properties.foo), '')), NULL, if(and(in(ascii(toString(e.person_properties.foo)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.foo)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.foo), '[]'), '{}'), toString(e.person_properties.foo)))), 'bar'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
+ WHERE and(equals(e.team_id, 99999), and(and(greaterOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC')), lessOrEquals(e.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(e.event, tuple('$pageview', 'insight analyzed')), ifNull(equals(CAST(e.person_properties.foo, 'Nullable(String)'), 'bar'), 0)), or(equals(step_0, 1), equals(step_1, 1))))
GROUP BY aggregation_target
HAVING ifNull(greaterOrEquals(step_reached, 0), 0))
WHERE bitTest(steps_bitfield, 0)
@@ -244,6 +246,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_data_warehouse.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_data_warehouse.new_events_schema.ambr
index 99d9fabfdf6f..aae572a062db 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_data_warehouse.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_data_warehouse.new_events_schema.ambr
@@ -81,7 +81,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelDataWarehouse.test_funnels_data_warehouse_and_regular_nodes_string_aggregation_target[new_events_schema]
@@ -166,7 +167,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelDataWarehouse.test_funnels_data_warehouse_and_regular_nodes_string_aggregation_target_actors[new_events_schema]
@@ -241,6 +243,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_insight_actors.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_insight_actors.new_events_schema.ambr
index 6e47e1b44e2d..30c9e1f72fb7 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_insight_actors.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_insight_actors.new_events_schema.ambr
@@ -61,6 +61,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_persons.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_persons.new_events_schema.ambr
index 2909f6b198e3..42ca06a63631 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_persons.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_persons.new_events_schema.ambr
@@ -60,7 +60,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelPersons.test_funnel_person_recordings[new_events_schema.2]
@@ -124,7 +125,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelPersons.test_funnel_person_recordings[new_events_schema]
@@ -188,6 +190,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict.new_events_schema.ambr
index c68889c5a64d..b61b97a0d46c 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict.new_events_schema.ambr
@@ -32,8 +32,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
- if(and(equals(e.event, 'buy'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`)))), 'xyz'), 0)), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ if(and(equals(e.event, 'buy'), ifNull(equals(CAST(e.properties.`$version`, 'Nullable(String)'), 'xyz'), 0)), 1, 0) AS step_1,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -65,7 +65,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelStrictStepsBreakdown.test_funnel_breakdown_correct_breakdown_props_are_chosen_for_step[new_events_schema]
@@ -101,8 +102,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
- if(and(equals(e.event, 'buy'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`)))), 'xyz'), 0)), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ if(and(equals(e.event, 'buy'), ifNull(equals(CAST(e.properties.`$version`, 'Nullable(String)'), 'xyz'), 0)), 1, 0) AS step_1,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
if(equals(step_1, 1), prop_basic, []) AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -134,7 +135,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelStrictStepsBreakdown.test_funnel_step_multiple_breakdown_snapshot[new_events_schema]
@@ -171,8 +173,8 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
if(equals(e.event, 'buy'), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
- ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
+ ifNull(toString(if(notEquals(toJSONString(e.properties.^`$version`), '{}'), toJSONString(e.properties.^`$version`), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -204,7 +206,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_aggregate_by_groups_breakdown_group_person_on_events[new_events_schema]
@@ -284,7 +287,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_breakdown_group[new_events_schema.1]
@@ -354,7 +358,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_breakdown_group[new_events_schema.2]
@@ -424,7 +429,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_breakdown_group[new_events_schema.3]
@@ -494,7 +500,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_breakdown_group[new_events_schema.4]
@@ -564,7 +571,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStrictFunnelGroupBreakdown.test_funnel_breakdown_group[new_events_schema]
@@ -651,6 +659,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict_persons.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict_persons.new_events_schema.ambr
index f1013c04b35c..a441c4825cfe 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict_persons.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_strict_persons.new_events_schema.ambr
@@ -60,7 +60,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelStrictStepsPersons.test_strict_funnel_person_recordings[new_events_schema.2]
@@ -124,7 +125,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelStrictStepsPersons.test_strict_funnel_person_recordings[new_events_schema]
@@ -188,6 +190,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_time_to_convert.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_time_to_convert.new_events_schema.ambr
index 43bb7d983ef7..1e4b32fd1090 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_time_to_convert.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_time_to_convert.new_events_schema.ambr
@@ -62,7 +62,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTimeToConvert.test_basic_strict[new_events_schema]
@@ -128,7 +129,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTimeToConvert.test_basic_unordered[new_events_schema]
@@ -194,6 +196,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends.new_events_schema.ambr
index 9f82c965e0c9..69aceafa2139 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends.new_events_schema.ambr
@@ -51,7 +51,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsUDF.test_timezones_trends[new_events_schema]
@@ -106,7 +107,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsUDF.test_week_interval[new_events_schema.1]
@@ -160,7 +162,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsUDF.test_week_interval[new_events_schema]
@@ -215,6 +218,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends_actors.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends_actors.new_events_schema.ambr
index f439100c0627..deab87441dd2 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends_actors.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_trends_actors.new_events_schema.ambr
@@ -21,7 +21,7 @@
if(equals(e.event, 'step one'), 1, 0) AS step_0,
if(equals(e.event, 'step two'), 1, 0) AS step_1,
if(equals(e.event, 'step three'), 1, 0) AS step_2,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -52,7 +52,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_filters_by_breakdown[new_events_schema.2]
@@ -77,7 +78,7 @@
if(equals(e.event, 'step one'), 1, 0) AS step_0,
if(equals(e.event, 'step two'), 1, 0) AS step_1,
if(equals(e.event, 'step three'), 1, 0) AS step_2,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -108,7 +109,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_filters_by_breakdown[new_events_schema]
@@ -133,7 +135,7 @@
if(equals(e.event, 'step one'), 1, 0) AS step_0,
if(equals(e.event, 'step two'), 1, 0) AS step_1,
if(equals(e.event, 'step three'), 1, 0) AS step_2,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -164,7 +166,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_returns_recording_when_converting_step_has_no_session_id[new_events_schema]
@@ -226,7 +229,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_returns_recordings[new_events_schema]
@@ -288,7 +292,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_with_drop_off[new_events_schema]
@@ -350,7 +355,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelTrendsActors.test_funnel_trend_persons_with_no_to_step[new_events_schema]
@@ -412,6 +418,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_unordered.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_unordered.new_events_schema.ambr
index 8dcfd716dfd0..c01d907dcb80 100644
--- a/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_unordered.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/funnels/test/__snapshots__/test_funnel_unordered.new_events_schema.ambr
@@ -76,7 +76,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedGroupBreakdown.test_funnel_breakdown_group[new_events_schema.1]
@@ -146,7 +147,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedGroupBreakdown.test_funnel_breakdown_group[new_events_schema.2]
@@ -216,7 +218,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedGroupBreakdown.test_funnel_breakdown_group[new_events_schema.3]
@@ -286,7 +289,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedGroupBreakdown.test_funnel_breakdown_group[new_events_schema.4]
@@ -356,7 +360,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedGroupBreakdown.test_funnel_breakdown_group[new_events_schema]
@@ -443,7 +448,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedStepsBreakdown.test_funnel_breakdown_correct_breakdown_props_are_chosen[new_events_schema]
@@ -479,8 +485,8 @@
e.properties.`$session_id` AS `$session_id`,
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
- if(and(equals(e.event, 'buy'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`)))), 'xyz'), 0)), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
+ if(and(equals(e.event, 'buy'), ifNull(equals(CAST(e.properties.`$version`, 'Nullable(String)'), 'xyz'), 0)), 1, 0) AS step_1,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -512,7 +518,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFunnelUnorderedStepsBreakdown.test_funnel_step_multiple_breakdown_snapshot[new_events_schema]
@@ -549,8 +556,8 @@
e.properties.`$window_id` AS `$window_id`,
if(equals(e.event, 'sign up'), 1, 0) AS step_0,
if(equals(e.event, 'buy'), 1, 0) AS step_1,
- [ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
- ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$version`)), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
+ [ifNull(toString(if(notEquals(toJSONString(e.properties.^`$browser`), '{}'), toJSONString(e.properties.^`$browser`), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`))))), ''),
+ ifNull(toString(if(notEquals(toJSONString(e.properties.^`$version`), '{}'), toJSONString(e.properties.^`$version`), if(isNull(nullIf(toString(e.properties.`$version`), '')), NULL, if(and(in(ascii(toString(e.properties.`$version`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$version`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$version`), '[]'), '{}'), toString(e.properties.`$version`))))), '')] AS prop_basic,
prop_basic AS prop
FROM events_json AS e
LEFT OUTER JOIN
@@ -582,6 +589,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_insight_actors.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_insight_actors.new_events_schema.ambr
index 793cd4ceb707..34a82186d3d9 100644
--- a/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_insight_actors.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_insight_actors.new_events_schema.ambr
@@ -31,7 +31,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-09 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-09 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
GROUP BY actor_id)
WHERE and(ifNull(equals(start_of_period, toStartOfInterval(toDateTime('2020-01-12', 'US/Pacific'), toIntervalDay(1))), isNull(start_of_period)
and isNull(toStartOfInterval(toDateTime('2020-01-12', 'US/Pacific'), toIntervalDay(1)))), equals(status, 'returning'))) AS source
@@ -58,7 +58,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-09 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-09 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
GROUP BY actor_id)
WHERE and(ifNull(equals(start_of_period, toStartOfInterval(toDateTime('2020-01-12', 'US/Pacific'), toIntervalDay(1))), isNull(start_of_period)
and isNull(toStartOfInterval(toDateTime('2020-01-12', 'US/Pacific'), toIntervalDay(1)))), equals(status, 'returning'))) AS source)))
@@ -78,6 +78,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_query_runner.new_events_schema.ambr
index 022d05eb4241..12a2ec8d9999 100644
--- a/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/lifecycle/test/__snapshots__/test_lifecycle_query_runner.new_events_schema.ambr
@@ -50,10 +50,10 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0)))), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0)))), equals(events.event, '$pageview'))
GROUP BY actor_id)
GROUP BY start_of_period,
status)
@@ -74,7 +74,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestLifecycleQueryRunner.test_sampling[new_events_schema]
@@ -128,7 +129,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), equals(events.event, '$pageview'))
GROUP BY actor_id)
GROUP BY start_of_period,
status)
@@ -149,7 +150,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestLifecycleQueryRunner.test_timezones[new_events_schema.1]
@@ -203,7 +205,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'US/Pacific')), toIntervalDay(1)), toIntervalDay(1)), 6, 'US/Pacific')), equals(events.event, '$pageview'))
GROUP BY actor_id)
GROUP BY start_of_period,
status)
@@ -224,7 +226,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestLifecycleQueryRunner.test_timezones[new_events_schema]
@@ -278,7 +281,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), ifNull(notEquals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$process_person_profile`)), if(isNull(nullIf(toString(events.properties.`$process_person_profile`), '')), NULL, if(and(in(ascii(toString(events.properties.`$process_person_profile`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$process_person_profile`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$process_person_profile`), '[]'), '{}'), toString(events.properties.`$process_person_profile`)))), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), equals(events.event, '$pageview'))
+ WHERE and(equals(events.team_id, 99999), ifNull(notEquals(CAST(events.properties.`$process_person_profile`, 'Nullable(String)'), 'false'), 1), greaterOrEquals(events.timestamp, toDateTime64(minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64(plus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-19 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(1)), 6, 'UTC')), equals(events.event, '$pageview'))
GROUP BY actor_id)
GROUP BY start_of_period,
status)
@@ -299,6 +302,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.new_events_schema.ambr
index 2c52cde14850..442dcc8e0f81 100644
--- a/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/paths/test/__snapshots__/test_paths_query_runner_ee.new_events_schema.ambr
@@ -47,7 +47,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -85,7 +85,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_end[new_events_schema]
@@ -136,7 +137,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -174,7 +175,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_exclusion_filters_with_wildcard_groups[new_events_schema.1]
@@ -225,7 +227,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
['/xxx/invalid/*'] AS groupings,
multiMatchAnyIndex(path_item_ungrouped, ['/xxx/invalid/.*']) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -262,7 +264,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_exclusion_filters_with_wildcard_groups[new_events_schema]
@@ -313,7 +316,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
['/bar/*/foo'] AS groupings,
multiMatchAnyIndex(path_item_ungrouped, ['/bar/.*/foo']) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -350,7 +353,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_inclusion_exclusion_filters[new_events_schema.1]
@@ -401,7 +405,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), events.event), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -438,7 +442,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_inclusion_exclusion_filters[new_events_schema.2]
@@ -526,7 +531,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_inclusion_exclusion_filters[new_events_schema.3]
@@ -577,7 +583,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -614,7 +620,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_inclusion_exclusion_filters[new_events_schema]
@@ -665,7 +672,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -702,7 +709,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_event_ordering[new_events_schema]
@@ -790,7 +798,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_groups_filtering_person_on_events[new_events_schema.1]
@@ -841,7 +850,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -886,7 +895,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_groups_filtering_person_on_events[new_events_schema.2]
@@ -937,7 +947,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -982,7 +992,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_groups_filtering_person_on_events[new_events_schema]
@@ -1033,7 +1044,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1078,7 +1089,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.1]
@@ -1162,8 +1174,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1200,7 +1212,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.2]
@@ -1284,8 +1297,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1322,7 +1335,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.3]
@@ -1406,8 +1420,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1444,7 +1458,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.4]
@@ -1528,8 +1543,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1566,7 +1581,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.5]
@@ -1650,8 +1666,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1688,7 +1704,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.6]
@@ -1772,8 +1789,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1810,7 +1827,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.7]
@@ -1894,8 +1912,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -1932,7 +1950,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema.8]
@@ -2016,8 +2035,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -2054,7 +2073,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_dropoffs[new_events_schema]
@@ -2138,8 +2158,8 @@
ifNull(events.event, '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -2176,7 +2196,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_person_on_events_v2[new_events_schema]
@@ -2227,7 +2248,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -2264,7 +2285,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_recording[new_events_schema]
@@ -2417,26 +2439,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -2620,26 +2642,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -2692,7 +2714,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_recording_for_dropoff[new_events_schema.1]
@@ -2845,26 +2868,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3049,26 +3072,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3122,7 +3145,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_recording_for_dropoff[new_events_schema]
@@ -3275,26 +3299,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3479,26 +3503,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3552,7 +3576,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_recording_with_no_window_or_session_id[new_events_schema]
@@ -3705,26 +3730,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3908,26 +3933,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -3980,7 +4005,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_recording_with_start_and_end[new_events_schema]
@@ -4196,26 +4222,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -4464,26 +4490,26 @@
if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id) AS person_id,
ifNull(if(equals(events.event,
- '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
- '\\1'), events.event), '') AS path_item_ungrouped,
- events.uuid AS uuid,
- toTimeZone(events.timestamp,
- 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
- NULL AS groupings,
- multiMatchAnyIndex(path_item_ungrouped,
- NULL) AS group_index, (if(ifNull(greater(group_index,
- 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
+ '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$',
+ '\\1'), events.event), '') AS path_item_ungrouped,
+ events.uuid AS uuid,
+ toTimeZone(events.timestamp,
+ 'UTC') AS timestamp,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ NULL AS groupings,
+ multiMatchAnyIndex(path_item_ungrouped,
+ NULL) AS group_index, (if(ifNull(greater(group_index,
+ 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
FROM events_json AS events
LEFT OUTER JOIN (
SELECT argMax(person_distinct_id_overrides.person_id,
@@ -4538,7 +4564,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_respect_session_limits[new_events_schema]
@@ -4589,7 +4616,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -4626,7 +4653,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_start_and_end[new_events_schema.1]
@@ -4715,11 +4743,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -4757,7 +4785,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_start_and_end[new_events_schema.2]
@@ -4812,7 +4841,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -4850,7 +4879,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_start_and_end[new_events_schema.3]
@@ -4939,11 +4969,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -4981,7 +5011,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_start_and_end[new_events_schema]
@@ -5036,7 +5067,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5074,7 +5105,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_start_dropping_orphaned_edges[new_events_schema]
@@ -5125,7 +5157,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5163,7 +5195,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_conversion_times[new_events_schema]
@@ -5214,7 +5247,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5251,7 +5284,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.1]
@@ -5332,11 +5366,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5373,7 +5407,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.2]
@@ -5454,11 +5489,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5495,7 +5530,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.3]
@@ -5546,7 +5582,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5583,7 +5619,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.4]
@@ -5664,11 +5701,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5705,7 +5742,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.5]
@@ -5756,7 +5794,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5793,7 +5831,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.6]
@@ -5874,11 +5913,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -5915,7 +5954,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.7]
@@ -5996,11 +6036,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -6037,7 +6077,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema.8]
@@ -6118,11 +6159,11 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
events.uuid AS uuid,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$session_id`)), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
- ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$window_id`)), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$session_id`), '{}'), toJSONString(events.properties.^`$session_id`), if(isNull(nullIf(toString(events.properties.`$session_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$session_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$session_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$session_id`), '[]'), '{}'), toString(events.properties.`$session_id`)))), '') AS session_id,
+ ifNull(if(notEquals(toJSONString(events.properties.^`$window_id`), '{}'), toJSONString(events.properties.^`$window_id`), if(isNull(nullIf(toString(events.properties.`$window_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$window_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$window_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$window_id`), '[]'), '{}'), toString(events.properties.`$window_id`)))), '') AS window_id,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -6159,7 +6200,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_step_limit[new_events_schema]
@@ -6210,7 +6252,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$screen'), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$screen'), if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))), if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event)), '') AS path_item_ungrouped,
NULL AS groupings,
multiMatchAnyIndex(path_item_ungrouped, NULL) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -6247,7 +6289,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_wildcard_groups_across_people[new_events_schema]
@@ -6298,7 +6341,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
['/bar/*/foo'] AS groupings,
multiMatchAnyIndex(path_item_ungrouped, ['/bar/.*/foo']) AS group_index,
(if(ifNull(greater(group_index, 0), 0), groupings[group_index], path_item_ungrouped) AS path_item) AS path_item
@@ -6335,7 +6378,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhousePaths.test_wildcard_groups_evil_input[new_events_schema]
@@ -6386,7 +6430,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
+ ifNull(if(equals(events.event, '$pageview'), replaceRegexpAll(ifNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), ''), '(.)/$', '\\1'), events.event), '') AS path_item_ungrouped,
['(a+)+',
'[aaa|aaaa]+',
'1.*',
@@ -6428,6 +6472,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/paths_v2/test/__snapshots__/test_paths_v2_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/paths_v2/test/__snapshots__/test_paths_v2_query_runner.new_events_schema.ambr
index 8ae7159a3931..889ad01fef0f 100644
--- a/products/product_analytics/backend/hogql_queries/paths_v2/test/__snapshots__/test_paths_v2_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/paths_v2/test/__snapshots__/test_paths_v2_query_runner.new_events_schema.ambr
@@ -20,7 +20,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS actor_id,
- tuple(events.event, ifNull(multiIf(equals(events.event, '$pageview'), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), NULL), '')) AS path_item
+ tuple(events.event, ifNull(multiIf(equals(events.event, '$pageview'), toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), NULL), '')) AS path_item
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -45,7 +45,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestPathsV2QueryRunner.test_default_pageview_preset_snapshot[new_events_schema]
@@ -95,7 +96,7 @@
FROM
(SELECT toTimeZone(events.timestamp, 'UTC') AS timestamp,
if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS actor_id,
- tuple(events.event, ifNull(multiIf(equals(events.event, '$pageview'), toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), NULL), '')) AS path_item
+ tuple(events.event, ifNull(multiIf(equals(events.event, '$pageview'), toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), NULL), '')) AS path_item
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -132,6 +133,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse.new_events_schema.ambr
index da190b086c1f..36a68cf006be 100644
--- a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse.new_events_schema.ambr
@@ -49,7 +49,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetentionDataWarehouse.test_retention_data_warehouse_and_events_1_String[new_events_schema]
@@ -102,6 +103,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse_24h_window.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse_24h_window.new_events_schema.ambr
index aa00518e9bb4..7fe830ac6964 100644
--- a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse_24h_window.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_data_warehouse_24h_window.new_events_schema.ambr
@@ -46,6 +46,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_query_runner.new_events_schema.ambr
index 323afece69ec..14d1170c633d 100644
--- a/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/retention/test/__snapshots__/test_retention_query_runner.new_events_schema.ambr
@@ -43,7 +43,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_groups_aggregating[new_events_schema.2]
@@ -78,7 +79,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_groups_aggregating[new_events_schema]
@@ -113,7 +115,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_groups_aggregating_person_on_events[new_events_schema.1]
@@ -160,7 +163,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_groups_aggregating_person_on_events[new_events_schema.2]
@@ -195,7 +199,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_groups_aggregating_person_on_events[new_events_schema]
@@ -230,7 +235,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_retention_24h_window_calculation[new_events_schema.1]
@@ -283,7 +289,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_retention_24h_window_calculation[new_events_schema.2]
@@ -325,7 +332,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_retention_24h_window_calculation[new_events_schema.3]
@@ -378,7 +386,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestClickhouseRetentionGroupAggregation.test_retention_24h_window_calculation[new_events_schema]
@@ -420,7 +429,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_day_interval_sampled[new_events_schema]
@@ -462,7 +472,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_month_interval_with_person_on_events_v2[new_events_schema]
@@ -504,7 +515,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_aggregation_different_events_ignores_start_event_property_value[new_events_schema]
@@ -578,7 +590,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_aggregation_sum[new_events_schema]
@@ -648,7 +661,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_event_action[new_events_schema]
@@ -690,7 +704,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_first_ever_single_scan_filters_by_event_name_only[new_events_schema.1]
@@ -708,7 +723,7 @@
and isNull(interval_date)), minus(interval_index, 1), -1), arrayEnumerate(date_range), date_range, arrayResize([start_event_timestamps], length(date_range), start_event_timestamps)))) AS start_interval_index,
arrayJoin(arrayConcat(if(ifNull(equals(start_event_timestamps[1], date_range[plus(start_interval_index, 1)]), isNull(start_event_timestamps[1])
and isNull(date_range[plus(start_interval_index, 1)])), [0], []), arrayFilter(x -> ifNull(greater(x, 0), 0), arrayMap(_timestamp -> minus(indexOf(arraySlice(date_range, plus(start_interval_index, 1), 5), _timestamp), 1), return_event_timestamps)))) AS intervals_from_base,
- argMinIf(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), ''), toTimeZone(events.timestamp, 'UTC'), equals(events.event, 'signup')) AS breakdown_value
+ argMinIf(ifNull(toString(if(notEquals(toJSONString(events.properties.^plan), '{}'), toJSONString(events.properties.^plan), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan))))), ''), toTimeZone(events.timestamp, 'UTC'), equals(events.event, 'signup')) AS breakdown_value
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -738,7 +753,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_first_ever_single_scan_filters_by_event_name_only[new_events_schema]
@@ -748,9 +764,9 @@
count(DISTINCT actor_activity.actor_id) AS count
FROM
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS actor_id,
- if(and(greaterOrEquals(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), [toTimeZone(toStartOfInterval(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toIntervalDay(1)), 'UTC')], []) AS start_event_timestamps,
+ if(and(greaterOrEquals(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), [toTimeZone(toStartOfInterval(if(equals(minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)))), minIf(toTimeZone(events.timestamp, 'UTC'), and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0))), NULL), toIntervalDay(1)), 'UTC')], []) AS start_event_timestamps,
arrayMap(x -> plus(toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(x)), range(0, 5)) AS date_range,
- arraySort(groupUniqArrayIf(toStartOfDay(toTimeZone(events.timestamp, 'UTC')), and(and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))))) AS return_event_timestamps,
+ arraySort(groupUniqArrayIf(toStartOfDay(toTimeZone(events.timestamp, 'UTC')), and(and(equals(events.event, 'act_a'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%/dash%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))))) AS return_event_timestamps,
arrayJoin(arrayFilter(x -> ifNull(greater(x, -1), 0), arrayMap((interval_index, interval_date, _start_event_timestamps) -> if(ifNull(equals(_start_event_timestamps[1], interval_date), isNull(_start_event_timestamps[1])
and isNull(interval_date)), minus(interval_index, 1), -1), arrayEnumerate(date_range), date_range, arrayResize([start_event_timestamps], length(date_range), start_event_timestamps)))) AS start_interval_index,
arrayJoin(arrayConcat(if(ifNull(equals(start_event_timestamps[1], date_range[plus(start_interval_index, 1)]), isNull(start_event_timestamps[1])
@@ -782,7 +798,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_first_time_vs_first_ever_occurrence[new_events_schema.1]
@@ -803,7 +820,7 @@
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
1 AS is_start,
- and(equals(events.event, 'target_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^prop)), if(isNull(nullIf(toString(events.properties.prop), '')), NULL, if(and(in(ascii(toString(events.properties.prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.prop), '[]'), '{}'), toString(events.properties.prop)))), 'correct'), 0)) AS matches_start,
+ and(equals(events.event, 'target_event'), ifNull(equals(CAST(events.properties.prop, 'Nullable(String)'), 'correct'), 0)) AS matches_start,
0 AS is_return
FROM events_json AS events
LEFT OUTER JOIN
@@ -846,7 +863,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_first_time_vs_first_ever_occurrence[new_events_schema]
@@ -877,7 +895,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), in(events.event, tuple('target_event')), and(equals(events.event, 'target_event'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^prop)), if(isNull(nullIf(toString(events.properties.prop), '')), NULL, if(and(in(ascii(toString(events.properties.prop)), tuple(91, 123)), in(ascii(toJSONString(events.properties.prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.prop), '[]'), '{}'), toString(events.properties.prop)))), 'correct'), 0)))
+ WHERE and(equals(events.team_id, 99999), in(events.event, tuple('target_event')), and(equals(events.event, 'target_event'), ifNull(equals(CAST(events.properties.prop, 'Nullable(String)'), 'correct'), 0)))
UNION ALL SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
0 AS is_start,
@@ -910,7 +928,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_retention_with_user_properties_via_action[new_events_schema]
@@ -920,7 +939,7 @@
count(DISTINCT actor_activity.actor_id) AS count
FROM
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS actor_id,
- arraySort(groupUniqArrayIf(toStartOfDay(toTimeZone(events.timestamp, 'UTC')), and(or(and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0)), equals(events.event, 'non_matching_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))))) AS start_event_timestamps,
+ arraySort(groupUniqArrayIf(toStartOfDay(toTimeZone(events.timestamp, 'UTC')), and(or(and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0)), equals(events.event, 'non_matching_event')), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))))) AS start_event_timestamps,
arrayMap(x -> plus(toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(x)), range(0, 7)) AS date_range,
arraySort(groupUniqArrayIf(toStartOfDay(toTimeZone(events.timestamp, 'UTC')), and(equals(events.event, '$pageview'), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1))), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('explicit_redacted_timestamp', 6, 'UTC')))))) AS return_event_timestamps,
arrayJoin(arrayFilter(x -> ifNull(greater(x, -1), 0), arrayMap((interval_index, interval_date, _start_event_timestamps) -> if(has(_start_event_timestamps, interval_date), minus(interval_index, 1), -1), arrayEnumerate(date_range), date_range, arrayResize([start_event_timestamps], length(date_range), start_event_timestamps)))) AS start_interval_index,
@@ -933,7 +952,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(greaterOrEquals(events.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(events.event, tuple('$pageview', 'non_matching_event')), or(or(and(equals(events.event, '$pageview'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email)))), '[email protected]'), 0)), equals(events.event, 'non_matching_event')), equals(events.event, '$pageview')))
+ WHERE and(equals(events.team_id, 99999), and(greaterOrEquals(events.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-06-10 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), less(events.timestamp, toDateTime64('explicit_redacted_timestamp', 6, 'UTC'))), in(events.event, tuple('$pageview', 'non_matching_event')), or(or(and(equals(events.event, '$pageview'), ifNull(equals(CAST(events.person_properties.email, 'Nullable(String)'), '[email protected]'), 0)), equals(events.event, 'non_matching_event')), equals(events.event, '$pageview')))
GROUP BY actor_id
HAVING 1) AS actor_activity
GROUP BY start_event_matching_interval,
@@ -952,7 +971,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_timezones[new_events_schema.1]
@@ -994,7 +1014,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_timezones[new_events_schema]
@@ -1036,7 +1057,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_week_interval[new_events_schema.1]
@@ -1078,7 +1100,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestRetention.test_week_interval[new_events_schema]
@@ -1120,6 +1143,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_insight_actors.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_insight_actors.new_events_schema.ambr
index 45f37656b88a..24ea605ceea9 100644
--- a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_insight_actors.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_insight_actors.new_events_schema.ambr
@@ -41,7 +41,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessInsightActors.test_insight_persons_stickiness_query[new_events_schema]
@@ -114,6 +115,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.new_events_schema.ambr
index c1415f87debb..7ec608c2e83f 100644
--- a/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/stickiness/test/__snapshots__/test_stickiness_query_runner.new_events_schema.ambr
@@ -34,7 +34,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_actor_query_cumulative[new_events_schema.2]
@@ -72,7 +73,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_actor_query_cumulative[new_events_schema]
@@ -110,7 +112,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_actor_query_non_cumulative[new_events_schema.1]
@@ -148,7 +151,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_actor_query_non_cumulative[new_events_schema.2]
@@ -186,7 +190,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_actor_query_non_cumulative[new_events_schema]
@@ -224,7 +229,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_cumulative_stickiness[new_events_schema]
@@ -275,7 +281,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestStickinessQueryRunner.test_stickiness_runs[new_events_schema]
@@ -326,6 +333,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.new_events_schema.ambr
index 53e4613fe70a..474948bd87bd 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_boxplot_trends_query_runner.new_events_schema.ambr
@@ -24,7 +24,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_day_format_varies_by_interval_0_day[new_events_schema]
@@ -52,7 +53,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_day_format_varies_by_interval_1_hour[new_events_schema]
@@ -80,7 +82,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_day_format_varies_by_interval_2_minute[new_events_schema]
@@ -108,7 +111,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_day_format_varies_by_interval_3_week[new_events_schema]
@@ -136,7 +140,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_day_format_varies_by_interval_4_month[new_events_schema]
@@ -164,7 +169,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_each_datum_has_label_and_day[new_events_schema]
@@ -192,7 +198,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_filter_test_accounts_0_filter_test_accounts_off[new_events_schema]
@@ -220,7 +227,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_filter_test_accounts_1_filter_test_accounts_on[new_events_schema]
@@ -233,7 +241,7 @@
max(accurateCastOrNull(e.properties.revenue, 'Float64')) AS max_val,
avg(accurateCastOrNull(e.properties.revenue, 'Float64')) AS mean_val
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), ifNull(notILike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1))
GROUP BY day_start
ORDER BY day_start ASC
LIMIT 100 SETTINGS readonly=2,
@@ -248,7 +256,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_multiple_days_produce_separate_buckets_with_correct_stats[new_events_schema]
@@ -276,7 +285,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_multiple_series_returns_data_for_each[new_events_schema.1]
@@ -304,7 +314,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_multiple_series_returns_data_for_each[new_events_schema]
@@ -332,7 +343,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_multiple_users_aggregate_within_same_day[new_events_schema]
@@ -360,7 +372,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_no_data_fills_all_dates_with_zeros[new_events_schema]
@@ -388,7 +401,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_none_property_values_become_zero_0_all_missing[new_events_schema]
@@ -416,7 +430,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_none_property_values_become_zero_1_single_missing[new_events_schema]
@@ -444,7 +459,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_property_filters_0_filter_chrome_only[new_events_schema]
@@ -457,7 +473,7 @@
max(accurateCastOrNull(e.properties.revenue, 'Float64')) AS max_val,
avg(accurateCastOrNull(e.properties.revenue, 'Float64')) AS mean_val
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Chrome'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), equals(e.properties.`$browser`, 'Chrome'))
GROUP BY day_start
ORDER BY day_start ASC
LIMIT 100 SETTINGS readonly=2,
@@ -472,7 +488,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_property_filters_1_filter_firefox_only[new_events_schema]
@@ -485,7 +502,7 @@
max(accurateCastOrNull(e.properties.revenue, 'Float64')) AS max_val,
avg(accurateCastOrNull(e.properties.revenue, 'Float64')) AS mean_val
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Firefox'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-12-02 23:59:59', 'UTC'))), equals(e.properties.`$browser`, 'Firefox'))
GROUP BY day_start
ORDER BY day_start ASC
LIMIT 100 SETTINGS readonly=2,
@@ -500,7 +517,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_property_filters_2_no_filter_sees_both[new_events_schema]
@@ -528,7 +546,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_results_are_ordered_by_day_ascending[new_events_schema]
@@ -556,7 +575,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_session_duration_produces_boxplot_data[new_events_schema]
@@ -595,7 +615,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_sparse_data_fills_missing_dates_with_zeros[new_events_schema]
@@ -623,7 +644,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_0_uniform_distribution[new_events_schema]
@@ -651,7 +673,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_1_single_value[new_events_schema]
@@ -679,7 +702,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_2_two_values[new_events_schema]
@@ -707,7 +731,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_3_identical_values[new_events_schema]
@@ -735,7 +760,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_4_negative_values[new_events_schema]
@@ -763,7 +789,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_5_large_values[new_events_schema]
@@ -791,7 +818,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestBoxPlotTrendsQueryRunner.test_statistics_for_distribution_6_decimal_values[new_events_schema]
@@ -819,6 +847,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_formula.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_formula.new_events_schema.ambr
index 7d122e382aff..b3632c3f4185 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_formula.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_formula.new_events_schema.ambr
@@ -17,7 +17,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_aggregated_one_without_events[new_events_schema]
@@ -38,7 +39,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown[new_events_schema.1]
@@ -59,7 +61,7 @@
FROM
(SELECT ifNull(avg(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -85,7 +87,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown[new_events_schema]
@@ -106,7 +109,7 @@
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -132,7 +135,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_aggregated[new_events_schema.1]
@@ -149,7 +153,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT ifNull(avg(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY breakdown_value)
@@ -173,7 +177,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_aggregated[new_events_schema]
@@ -190,7 +195,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY breakdown_value)
@@ -214,7 +219,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_cohort[new_events_schema.1]
@@ -261,7 +267,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_cohort[new_events_schema.2]
@@ -318,7 +325,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_cohort[new_events_schema.3]
@@ -375,7 +383,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_cohort[new_events_schema]
@@ -422,7 +431,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_hogql[new_events_schema.1]
@@ -443,7 +453,7 @@
FROM
(SELECT ifNull(avg(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(concat(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), ''), ' : ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), ''))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(concat(ifNull(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), ''), ' : ', ifNull(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), ''))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -469,7 +479,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_hogql[new_events_schema]
@@ -490,7 +501,7 @@
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(concat(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), ''), ' : ', ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), ''))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(concat(ifNull(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), ''), ' : ', ifNull(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), ''))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -516,7 +527,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_hogql_with_as_alias[new_events_schema.1]
@@ -537,7 +549,7 @@
FROM
(SELECT ifNull(avg(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -563,7 +575,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_hogql_with_as_alias[new_events_schema]
@@ -584,7 +597,7 @@
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -610,7 +623,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_with_different_breakdown_values_per_series[new_events_schema.1]
@@ -631,7 +645,7 @@
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session end'))
GROUP BY day_start,
@@ -657,7 +671,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_breakdown_with_different_breakdown_values_per_series[new_events_schema]
@@ -678,7 +693,7 @@
FROM
(SELECT ifNull(sum(accurateCastOrNull(e.properties.xyz, 'Float64')), 0) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^location)), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^location), '{}'), toJSONString(e.properties.^location), if(isNull(nullIf(toString(e.properties.location), '')), NULL, if(and(in(ascii(toString(e.properties.location)), tuple(91, 123)), in(ascii(toJSONString(e.properties.location)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.location), '[]'), '{}'), toString(e.properties.location))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'session start'))
GROUP BY day_start,
@@ -704,7 +719,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_formula_with_hogql_math_no_matching_events[new_events_schema.1]
@@ -725,7 +741,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_formula_with_hogql_math_no_matching_events[new_events_schema]
@@ -746,7 +763,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_formula_with_unique_sessions[new_events_schema.1]
@@ -785,7 +803,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_formula_with_unique_sessions[new_events_schema]
@@ -817,7 +836,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_hour_interval_day_level_relative[new_events_schema.1]
@@ -849,7 +869,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_hour_interval_day_level_relative[new_events_schema]
@@ -881,7 +902,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_hour_interval_hour_level_relative[new_events_schema.1]
@@ -913,7 +935,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_hour_interval_hour_level_relative[new_events_schema]
@@ -945,7 +968,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_session_duration_aggregation[new_events_schema.1]
@@ -977,7 +1001,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_session_duration_aggregation[new_events_schema]
@@ -1021,7 +1046,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_unique_sessions_2x_and_duration_filter[new_events_schema.1]
@@ -1053,7 +1079,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_unique_sessions_2x_and_duration_filter[new_events_schema]
@@ -1091,7 +1118,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_unique_sessions_2x_and_duration_filter_2x[new_events_schema.1]
@@ -1129,7 +1157,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestFormula.test_regression_formula_with_unique_sessions_2x_and_duration_filter_2x[new_events_schema]
@@ -1167,6 +1196,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_slope_graph_trends_query_runner.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_slope_graph_trends_query_runner.new_events_schema.ambr
index 7e6c8e62dd54..1c0299e3d15c 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_slope_graph_trends_query_runner.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_slope_graph_trends_query_runner.new_events_schema.ambr
@@ -48,7 +48,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_breakdown_produces_one_two_point_line_per_value[new_events_schema]
@@ -69,7 +70,7 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), if(isNull(nullIf(toString(e.properties.plan), '')), NULL, if(and(in(ascii(toString(e.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(e.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.plan), '[]'), '{}'), toString(e.properties.plan))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^plan), '{}'), toJSONString(e.properties.^plan), if(isNull(nullIf(toString(e.properties.plan), '')), NULL, if(and(in(ascii(toString(e.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(e.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.plan), '[]'), '{}'), toString(e.properties.plan))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-05-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2024-05-10 23:59:59', 'UTC'))), equals(e.event, '$pageview'), or(and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-01 00:00:00', 6, 'UTC')), less(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-02 00:00:00', 6, 'UTC'))), and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 00:00:00', 6, 'UTC')), lessOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 23:59:59', 6, 'UTC')))))
GROUP BY day_start,
@@ -95,7 +96,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_formula_series[new_events_schema]
@@ -127,7 +129,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_groups_by_month_returning_first_and_last_month[new_events_schema]
@@ -159,7 +162,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_hour_interval_first_and_last_hour[new_events_schema]
@@ -191,7 +195,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_keeps_the_query_property_filter_alongside_the_bucket_restriction[new_events_schema]
@@ -206,7 +211,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-05-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2024-05-10 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), if(isNull(nullIf(toString(e.properties.plan), '')), NULL, if(and(in(ascii(toString(e.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(e.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.plan), '[]'), '{}'), toString(e.properties.plan)))), 'paid'), 0), or(and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-01 00:00:00', 6, 'UTC')), less(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-02 00:00:00', 6, 'UTC'))), and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 00:00:00', 6, 'UTC')), lessOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 23:59:59', 6, 'UTC'))))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-05-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2024-05-10 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(CAST(e.properties.plan, 'Nullable(String)'), 'paid'), 0), or(and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-01 00:00:00', 6, 'UTC')), less(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-02 00:00:00', 6, 'UTC'))), and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 00:00:00', 6, 'UTC')), lessOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 23:59:59', 6, 'UTC'))))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -223,7 +228,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_last_bucket_is_the_current_partial_period_not_trimmed[new_events_schema]
@@ -255,7 +261,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_monthly_active_math_keeps_its_trailing_window[new_events_schema]
@@ -307,7 +314,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_no_events_yields_zero_endpoints[new_events_schema]
@@ -339,7 +347,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_non_utc_team_timezone[new_events_schema]
@@ -371,7 +380,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_preserves_a_property_group_filter[new_events_schema]
@@ -386,7 +396,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-05-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2024-05-10 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^plan)), if(isNull(nullIf(toString(e.properties.plan), '')), NULL, if(and(in(ascii(toString(e.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(e.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.plan), '[]'), '{}'), toString(e.properties.plan)))), 'paid'), 0), or(and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-01 00:00:00', 6, 'UTC')), less(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-02 00:00:00', 6, 'UTC'))), and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 00:00:00', 6, 'UTC')), lessOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 23:59:59', 6, 'UTC'))))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2024-05-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2024-05-10 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(CAST(e.properties.plan, 'Nullable(String)'), 'paid'), 0), or(and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-01 00:00:00', 6, 'UTC')), less(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-02 00:00:00', 6, 'UTC'))), and(greaterOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 00:00:00', 6, 'UTC')), lessOrEquals(e.timestamp, parseDateTime64BestEffortOrNull('2024-05-10 23:59:59', 6, 'UTC'))))))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -403,7 +413,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_relative_date_range[new_events_schema]
@@ -435,7 +446,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_returns_first_and_last_day_buckets_ignoring_the_middle[new_events_schema]
@@ -467,7 +479,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_single_bucket_range_yields_a_one_point_series[new_events_schema]
@@ -499,7 +512,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_smoothing_does_not_starve_the_last_point[new_events_schema]
@@ -531,7 +545,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_unique_users_math_is_per_bucket[new_events_schema]
@@ -570,7 +585,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSlopeGraphTrendsQueryRunner.test_week_interval_scan_filter_aligns_with_the_buckets[new_events_schema]
@@ -602,6 +618,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends.new_events_schema.ambr
index 6e97f0ba16b3..957b59c516c5 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends.new_events_schema.ambr
@@ -21,7 +21,7 @@
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-07 23:59:59', 'UTC'))), and(equals(e.event, 'sign up'), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id),
(SELECT cohortpeople.person_id AS person_id
FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 2))))), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$bool_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$bool_prop`)), if(isNull(nullIf(toString(e.person_properties.`$bool_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$bool_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$bool_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$bool_prop`), '[]'), '{}'), toString(e.person_properties.`$bool_prop`)))), 'x'), 0))
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 2))))), ifNull(equals(CAST(e.person_properties.`$bool_prop`, 'Nullable(String)'), 'x'), 0))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -38,7 +38,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_by_group_props_person_on_events[new_events_schema.1]
@@ -121,7 +122,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_by_group_props_person_on_events[new_events_schema]
@@ -176,7 +178,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_by_group_props_with_person_filter_person_on_events[new_events_schema]
@@ -207,7 +210,7 @@
WHERE and(equals(groups.team_id, 99999), equals(index, 0))
GROUP BY groups.group_type_index,
groups.group_key) AS e__group_0 ON equals(e.properties.`$group_0`, e__group_0.key)
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))), equals(e.event, 'sign up'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^key)), if(isNull(nullIf(toString(e.person_properties.key), '')), NULL, if(and(in(ascii(toString(e.person_properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.key), '[]'), '{}'), toString(e.person_properties.key)))), 'value'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))), equals(e.event, 'sign up'), ifNull(equals(CAST(e.person_properties.key, 'Nullable(String)'), 'value'), 0))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -231,7 +234,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_filtering_with_properties_in_new_format[new_events_schema.1]
@@ -252,9 +256,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Windows'), 0)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Mac'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(equals(e.properties.`$browser`, 'Firefox'), equals(e.properties.`$os`, 'Windows')), equals(e.properties.`$os`, 'Mac'))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -278,7 +282,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_filtering_with_properties_in_new_format[new_events_schema.2]
@@ -299,9 +304,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Windows'), 0)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Mac'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), or(equals(e.properties.`$browser`, 'Firefox'), equals(e.properties.`$os`, 'Windows')), equals(e.properties.`$os`, 'Mac'))
GROUP BY day_start,
breakdown_value_1)
GROUP BY day_start,
@@ -325,7 +330,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_filtering_with_properties_in_new_format[new_events_schema.3]
@@ -346,9 +352,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Windows'), 0)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Mac'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(equals(e.properties.`$browser`, 'Firefox'), equals(e.properties.`$os`, 'Windows')), equals(e.properties.`$os`, 'Mac'))
GROUP BY day_start,
breakdown_value_1)
GROUP BY day_start,
@@ -372,7 +378,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_filtering_with_properties_in_new_format[new_events_schema]
@@ -393,9 +400,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$browser`)), if(isNull(nullIf(toString(e.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$browser`), '[]'), '{}'), toString(e.properties.`$browser`)))), 'Firefox'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Windows'), 0)), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`)))), 'Mac'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-22 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-05 23:59:59', 'UTC'))), equals(e.event, 'sign up'), or(equals(e.properties.`$browser`, 'Firefox'), equals(e.properties.`$os`, 'Windows')), equals(e.properties.`$os`, 'Mac'))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -419,7 +426,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_weekly_active_users_aggregated[new_events_schema]
@@ -444,7 +452,7 @@
FROM
(SELECT toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS timestamp,
if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS actor_id,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^key), '{}'), toJSONString(e.properties.^key), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -486,7 +494,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_weekly_active_users_daily_based_on_action[new_events_schema]
@@ -515,7 +524,7 @@
FROM
(SELECT toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS timestamp,
if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS actor_id,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^key), '{}'), toJSONString(e.properties.^key), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -524,10 +533,10 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(equals(e.event, '$pageview'), and(in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), if(isNull(nullIf(toString(e.person_properties.name), '')), NULL, if(and(in(ascii(toString(e.person_properties.name)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.name)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.name), '[]'), '{}'), toString(e.person_properties.name)))), tuple('p1', 'p2', 'p3')), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0)))))), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(7))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), and(equals(e.event, '$pageview'), and(in(CAST(e.person_properties.name, 'Nullable(String)'), tuple('p1', 'p2', 'p3')), in(if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999), equals(cohortpeople.version, 0)))))), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(7))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))))
GROUP BY timestamp, actor_id,
breakdown_value) AS e
CROSS JOIN
@@ -559,7 +568,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_with_filter_groups_person_on_events[new_events_schema]
@@ -580,7 +590,7 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^key), '{}'), toJSONString(e.properties.^key), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT JOIN
(SELECT tupleElement(argMax(tuple(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(groups.group_properties, 'industry'), ''), 'null'), '^"|"$', '')), toTimeZone(groups._timestamp, 'UTC')), 1) AS properties___industry,
@@ -614,7 +624,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_breakdown_with_filter_groups_person_on_events_v2[new_events_schema]
@@ -635,7 +646,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^key), '{}'), toJSONString(e.properties.^key), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -676,7 +687,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_dau_with_breakdown_filtering_with_sampling[new_events_schema.1]
@@ -697,7 +709,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -730,7 +742,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_dau_with_breakdown_filtering_with_sampling[new_events_schema.2]
@@ -751,7 +764,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -784,7 +797,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_dau_with_breakdown_filtering_with_sampling[new_events_schema.3]
@@ -805,7 +819,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -838,7 +852,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_dau_with_breakdown_filtering_with_sampling[new_events_schema]
@@ -859,7 +874,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -892,7 +907,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_filter_events_by_precalculated_cohort[new_events_schema]
@@ -934,7 +950,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_filtering_by_multiple_groups_person_on_events[new_events_schema.1]
@@ -1030,7 +1047,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_filtering_by_multiple_groups_person_on_events[new_events_schema]
@@ -1078,7 +1096,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_filtering_with_group_props_person_on_events[new_events_schema]
@@ -1101,7 +1120,7 @@
WHERE and(equals(groups.team_id, 99999), equals(index, 0))
GROUP BY groups.group_type_index,
groups.group_key) AS e__group_0 ON equals(e.properties.`$group_0`, e__group_0.key)
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(e__group_0.properties___industry, 'finance'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^key)), if(isNull(nullIf(toString(e.person_properties.key), '')), NULL, if(and(in(ascii(toString(e.person_properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.key), '[]'), '{}'), toString(e.person_properties.key)))), 'value'), 0)))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))), equals(e.event, '$pageview'), and(ifNull(equals(e__group_0.properties___industry, 'finance'), 0), ifNull(equals(CAST(e.person_properties.key, 'Nullable(String)'), 'value'), 0)))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -1118,7 +1137,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_mau_with_breakdown_filtering_and_prop_filter[new_events_schema.1]
@@ -1147,7 +1167,7 @@
FROM
(SELECT toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS timestamp,
if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS actor_id,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -1156,7 +1176,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(equals(e.event, 'sign up'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^filter_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^filter_prop)), if(isNull(nullIf(toString(e.person_properties.filter_prop), '')), NULL, if(and(in(ascii(toString(e.person_properties.filter_prop)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.filter_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.filter_prop), '[]'), '{}'), toString(e.person_properties.filter_prop)))), 'filter_val'), 0)), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(30))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), and(equals(e.event, 'sign up'), ifNull(equals(CAST(e.person_properties.filter_prop, 'Nullable(String)'), 'filter_val'), 0)), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(30))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))))
GROUP BY timestamp, actor_id,
breakdown_value_1) AS e
CROSS JOIN
@@ -1188,7 +1208,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_mau_with_breakdown_filtering_and_prop_filter[new_events_schema]
@@ -1217,7 +1238,7 @@
FROM
(SELECT toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS timestamp,
if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id) AS actor_id,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -1226,7 +1247,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(equals(e.event, 'sign up'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^filter_prop)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^filter_prop)), if(isNull(nullIf(toString(e.person_properties.filter_prop), '')), NULL, if(and(in(ascii(toString(e.person_properties.filter_prop)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.filter_prop)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.filter_prop), '[]'), '{}'), toString(e.person_properties.filter_prop)))), 'filter_val'), 0)), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(30))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), and(equals(e.event, 'sign up'), ifNull(equals(CAST(e.person_properties.filter_prop, 'Nullable(String)'), 'filter_val'), 0)), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(30))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))))
GROUP BY timestamp, actor_id,
breakdown_value) AS e
CROSS JOIN
@@ -1258,7 +1279,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_non_deterministic_timezones[new_events_schema]
@@ -1290,7 +1312,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_person_filtering_in_cohort_in_action[new_events_schema]
@@ -1311,7 +1334,7 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -1347,7 +1370,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_person_property_filtering[new_events_schema]
@@ -1362,7 +1386,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), if(isNull(nullIf(toString(e.person_properties.name), '')), NULL, if(and(in(ascii(toString(e.person_properties.name)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.name)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.name), '[]'), '{}'), toString(e.person_properties.name)))), 'person1'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(CAST(e.person_properties.name, 'Nullable(String)'), 'person1'), 0))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -1379,7 +1403,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_person_property_filtering_clashing_with_event_property[new_events_schema.1]
@@ -1394,7 +1419,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^name)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^name)), if(isNull(nullIf(toString(e.properties.name), '')), NULL, if(and(in(ascii(toString(e.properties.name)), tuple(91, 123)), in(ascii(toJSONString(e.properties.name)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.name), '[]'), '{}'), toString(e.properties.name)))), '1'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(CAST(e.properties.name, 'Nullable(String)'), '1'), 0))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -1411,7 +1436,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_person_property_filtering_clashing_with_event_property[new_events_schema]
@@ -1426,7 +1452,7 @@
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), if(isNull(nullIf(toString(e.person_properties.name), '')), NULL, if(and(in(ascii(toString(e.person_properties.name)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.name)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.name), '[]'), '{}'), toString(e.person_properties.name)))), 'person1'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-28 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-01-04 23:59:59', 'UTC'))), equals(e.event, 'watched movie'), ifNull(equals(CAST(e.person_properties.name, 'Nullable(String)'), 'person1'), 0))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -1443,7 +1469,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_same_day_with_person_on_events_v2[new_events_schema.1]
@@ -1482,7 +1509,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_same_day_with_person_on_events_v2[new_events_schema]
@@ -1514,7 +1542,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_same_day_with_person_on_events_v2_latest_override[new_events_schema.1]
@@ -1553,7 +1582,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_same_day_with_person_on_events_v2_latest_override[new_events_schema.2]
@@ -1592,7 +1622,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_same_day_with_person_on_events_v2_latest_override[new_events_schema]
@@ -1631,7 +1662,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_daily[new_events_schema.1]
@@ -1670,7 +1702,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_daily[new_events_schema.2]
@@ -1722,7 +1755,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_daily[new_events_schema.3]
@@ -1754,7 +1788,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_daily[new_events_schema.4]
@@ -1775,7 +1810,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$os`)), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$os`), '{}'), toJSONString(e.properties.^`$os`), if(isNull(nullIf(toString(e.properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$os`), '[]'), '{}'), toString(e.properties.`$os`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -1808,7 +1843,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_daily[new_events_schema]
@@ -1840,7 +1876,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_hourly_relative_from[new_events_schema.1]
@@ -1872,7 +1909,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_hourly_relative_from[new_events_schema]
@@ -1911,7 +1949,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_weekly[new_events_schema.1]
@@ -1943,7 +1982,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_timezones_weekly[new_events_schema]
@@ -1975,7 +2015,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trend_breakdown_user_props_with_filter_with_partial_property_pushdowns[new_events_schema.1]
@@ -1996,9 +2037,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-07-01 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$os`)), if(isNull(nullIf(toString(e.person_properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$os`), '[]'), '{}'), toString(e.person_properties.`$os`)))), 'android'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'chrome'), 0)), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key)))), 'val'), 0), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 0)))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-07-01 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(equals(e.person_properties.`$os`, 'android'), equals(e.person_properties.`$browser`, 'chrome')), and(ifNull(equals(CAST(e.properties.key, 'Nullable(String)'), 'val'), 0), ifNull(ilike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 0)))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -2022,7 +2063,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trend_breakdown_user_props_with_filter_with_partial_property_pushdowns[new_events_schema]
@@ -2043,9 +2085,9 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-07-01 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(or(ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^key)), if(isNull(nullIf(toString(e.properties.key), '')), NULL, if(and(in(ascii(toString(e.properties.key)), tuple(91, 123)), in(ascii(toJSONString(e.properties.key)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.key), '[]'), '{}'), toString(e.properties.key)))), 'val'), 0)), or(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$os`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$os`)), if(isNull(nullIf(toString(e.person_properties.`$os`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$os`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$os`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$os`), '[]'), '{}'), toString(e.person_properties.`$os`)))), 'android'), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$browser`)), if(isNull(nullIf(toString(e.person_properties.`$browser`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$browser`), '[]'), '{}'), toString(e.person_properties.`$browser`)))), 'safari'), 0))))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2020-07-01 23:59:59', 'UTC'))), equals(e.event, 'sign up'), and(or(ifNull(notILike(toString(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email))))), '%@posthog.com%'), 1), ifNull(equals(CAST(e.properties.key, 'Nullable(String)'), 'val'), 0)), or(equals(e.person_properties.`$os`, 'android'), equals(e.person_properties.`$browser`, 'safari'))))
GROUP BY day_start,
breakdown_value)
GROUP BY day_start,
@@ -2069,7 +2111,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.1]
@@ -2084,7 +2127,7 @@
(SELECT count(DISTINCT e.distinct_id) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
- WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-24 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2019-12-31 23:59:59', 'UTC'))), equals(e.event, 'sign up'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`)))), 'some_val'), 0))
+ WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-24 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2019-12-31 23:59:59', 'UTC'))), equals(e.event, 'sign up'), ifNull(equals(CAST(e.person_properties.`$some_prop`, 'Nullable(String)'), 'some_val'), 0))
GROUP BY day_start)
GROUP BY day_start
ORDER BY day_start ASC)
@@ -2101,7 +2144,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.2]
@@ -2122,7 +2166,7 @@
FROM
(SELECT count(DISTINCT e.distinct_id) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-24 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2019-12-31 23:59:59', 'UTC'))), equals(e.event, 'sign up'))
GROUP BY day_start,
@@ -2148,7 +2192,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.3]
@@ -2169,7 +2214,7 @@
FROM
(SELECT count(DISTINCT e.distinct_id) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-24 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2019-12-31 23:59:59', 'UTC'))), equals(e.event, 'sign up'))
GROUP BY day_start,
@@ -2195,7 +2240,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.4]
@@ -2240,7 +2286,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.5]
@@ -2285,7 +2332,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema.6]
@@ -2306,7 +2354,7 @@
FROM
(SELECT count(DISTINCT e.distinct_id) AS total,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_prop`)), if(isNull(nullIf(toString(e.properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_prop`), '[]'), '{}'), toString(e.properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_prop`), '{}'), toJSONString(e.properties.^`$some_prop`), if(isNull(nullIf(toString(e.properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_prop`), '[]'), '{}'), toString(e.properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2019-12-24 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2019-12-31 23:59:59', 'UTC'))), equals(e.event, 'sign up'))
GROUP BY day_start,
@@ -2332,7 +2380,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_aggregate_by_distinct_id[new_events_schema]
@@ -2364,7 +2413,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_any_event_total_count[new_events_schema.1]
@@ -2396,7 +2446,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_any_event_total_count[new_events_schema]
@@ -2428,7 +2479,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_cumulative[new_events_schema]
@@ -2454,7 +2506,7 @@
FROM
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
min(toStartOfDay(toTimeZone(e.timestamp, 'UTC'))) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -2488,7 +2540,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_normalize_url[new_events_schema]
@@ -2515,8 +2568,8 @@
(SELECT count(DISTINCT if(not(empty(e__override.distinct_id)), e__override.person_id, e.person_id)) AS total,
min(toStartOfDay(toTimeZone(e.timestamp, 'UTC'))) AS day_start,
ifNull(nullIf(leftUTF8(toString(if(empty(trim(TRAILING '/?#'
- FROM if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))))), '/', trim(TRAILING '/?#'
- FROM if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$current_url`)), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ FROM if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`)))))), '/', trim(TRAILING '/?#'
+ FROM if(notEquals(toJSONString(e.properties.^`$current_url`), '{}'), toJSONString(e.properties.^`$current_url`), if(isNull(nullIf(toString(e.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(e.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$current_url`), '[]'), '{}'), toString(e.properties.`$current_url`))))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -2550,7 +2603,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema.1]
@@ -2570,7 +2624,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -2602,7 +2656,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema.2]
@@ -2622,7 +2677,7 @@
breakdown_value_1 AS breakdown_value_1
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -2654,7 +2709,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema.3]
@@ -2674,7 +2730,7 @@
breakdown_value_1 AS breakdown_value_1
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -2706,7 +2762,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema]
@@ -2726,7 +2783,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -2758,7 +2815,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_compare_day_interval_relative_range[new_events_schema.1]
@@ -2790,7 +2848,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_compare_day_interval_relative_range[new_events_schema.2]
@@ -2822,7 +2881,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_compare_day_interval_relative_range[new_events_schema]
@@ -2854,7 +2914,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_count_per_user_average_aggregated[new_events_schema]
@@ -2886,7 +2947,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_count_per_user_average_aggregated_with_event_property_breakdown_with_sampling[new_events_schema]
@@ -2909,7 +2971,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT count() AS total,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^color)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^color)), if(isNull(nullIf(toString(e.properties.color), '')), NULL, if(and(in(ascii(toString(e.properties.color)), tuple(91, 123)), in(ascii(toJSONString(e.properties.color)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.color), '[]'), '{}'), toString(e.properties.color))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^color), '{}'), toJSONString(e.properties.^color), if(isNull(nullIf(toString(e.properties.color), '')), NULL, if(and(in(ascii(toString(e.properties.color)), tuple(91, 123)), in(ascii(toJSONString(e.properties.color)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.color), '[]'), '{}'), toString(e.properties.color))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -2942,7 +3004,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_count_per_user_average_daily[new_events_schema]
@@ -2989,7 +3052,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_groups_per_day[new_events_schema]
@@ -3021,7 +3085,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_groups_per_day_cumulative[new_events_schema]
@@ -3058,7 +3123,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_per_day_cumulative[new_events_schema]
@@ -3095,7 +3161,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_per_day_dau_cumulative[new_events_schema]
@@ -3139,7 +3206,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_person_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema.1]
@@ -3159,7 +3227,7 @@
breakdown_value_1 AS breakdown_value_1
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -3191,7 +3259,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_person_breakdown_with_session_property_single_aggregate_math_and_breakdown[new_events_schema]
@@ -3211,7 +3280,7 @@
breakdown_value AS breakdown_value
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^`$some_prop`)), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.person_properties.^`$some_prop`), '{}'), toJSONString(e.person_properties.^`$some_prop`), if(isNull(nullIf(toString(e.person_properties.`$some_prop`), '')), NULL, if(and(in(ascii(toString(e.person_properties.`$some_prop`)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.`$some_prop`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.`$some_prop`), '[]'), '{}'), toString(e.person_properties.`$some_prop`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value
FROM events_json AS e
LEFT JOIN
(SELECT dateDiff('second', min(toTimeZone(raw_sessions.min_timestamp, 'UTC')), max(toTimeZone(raw_sessions.max_timestamp, 'UTC'))) AS `$session_duration`,
@@ -3243,7 +3312,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_hogql_math[new_events_schema]
@@ -3275,7 +3345,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_single_aggregate_math[new_events_schema.1]
@@ -3305,7 +3376,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_single_aggregate_math[new_events_schema]
@@ -3335,7 +3407,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math[new_events_schema.1]
@@ -3379,7 +3452,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math[new_events_schema]
@@ -3423,7 +3497,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math_with_breakdowns[new_events_schema.1]
@@ -3447,7 +3522,7 @@
day_start AS day_start
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value,
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
LEFT JOIN
@@ -3484,7 +3559,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math_with_breakdowns[new_events_schema.2]
@@ -3508,7 +3584,7 @@
day_start AS day_start
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1,
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1,
toStartOfWeek(toTimeZone(e.timestamp, 'UTC'), 0) AS day_start
FROM events_json AS e
LEFT JOIN
@@ -3545,7 +3621,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math_with_breakdowns[new_events_schema.3]
@@ -3569,7 +3646,7 @@
day_start AS day_start
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1,
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value_1,
toStartOfDay(toTimeZone(e.timestamp, 'UTC')) AS day_start
FROM events_json AS e
LEFT JOIN
@@ -3606,7 +3683,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_trends_with_session_property_total_volume_math_with_breakdowns[new_events_schema]
@@ -3630,7 +3708,7 @@
day_start AS day_start
FROM
(SELECT any(e__session.`$session_duration`) AS session_duration,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^`$some_property`)), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value,
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^`$some_property`), '{}'), toJSONString(e.properties.^`$some_property`), if(isNull(nullIf(toString(e.properties.`$some_property`), '')), NULL, if(and(in(ascii(toString(e.properties.`$some_property`)), tuple(91, 123)), in(ascii(toJSONString(e.properties.`$some_property`)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.`$some_property`), '[]'), '{}'), toString(e.properties.`$some_property`))))), 400), ''), '$$_posthog_breakdown_null_$$') AS breakdown_value,
toStartOfWeek(toTimeZone(e.timestamp, 'UTC'), 0) AS day_start
FROM events_json AS e
LEFT JOIN
@@ -3667,7 +3745,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_groups_daily[new_events_schema]
@@ -3712,7 +3791,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_aggregated_range_narrower_than_week[new_events_schema]
@@ -3754,7 +3834,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_aggregated_range_wider_than_week[new_events_schema]
@@ -3796,7 +3877,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_aggregated_range_wider_than_week_with_sampling[new_events_schema]
@@ -3838,7 +3920,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_daily[new_events_schema]
@@ -3890,7 +3973,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_filtering[new_events_schema]
@@ -3918,7 +4002,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS e__override ON equals(e.distinct_id, e__override.distinct_id)
- WHERE and(equals(e.team_id, 99999), and(equals(e.event, '$pageview'), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^name)), if(isNull(nullIf(toString(e.person_properties.name), '')), NULL, if(and(in(ascii(toString(e.person_properties.name)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.name)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.name), '[]'), '{}'), toString(e.person_properties.name)))), tuple('person-1', 'person-2'))), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(7))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))))
+ WHERE and(equals(e.team_id, 99999), and(equals(e.event, '$pageview'), in(CAST(e.person_properties.name, 'Nullable(String)'), tuple('person-1', 'person-2'))), greaterOrEquals(timestamp, minus(assumeNotNull(toDateTime('2020-01-01 00:00:00', 'UTC')), toIntervalDay(7))), lessOrEquals(timestamp, assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC'))))
GROUP BY timestamp, actor_id) AS e
CROSS JOIN
(SELECT minus(toStartOfInterval(assumeNotNull(toDateTime('2020-01-12 23:59:59', 'UTC')), toIntervalDay(1)), toIntervalDay(numbers.number)) AS timestamp
@@ -3942,7 +4026,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_hourly[new_events_schema]
@@ -3994,7 +4079,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrends.test_weekly_active_users_weekly[new_events_schema]
@@ -4033,6 +4119,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.new_events_schema.ambr
index a87cde2435e3..93f2bf759d65 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.new_events_schema.ambr
@@ -28,7 +28,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrendsDataWarehouseQuery.test_trends_events_and_data_warehouse_all_time[new_events_schema]
@@ -49,7 +50,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrendsDataWarehouseQuery.test_trends_events_filtering_on_warehouse_person_property[new_events_schema.1]
@@ -67,7 +69,7 @@
LEFT JOIN
(SELECT posthog_test_test_table_1.id AS id,
posthog_test_test_table_1.prop_1 AS e__posthog_test_test_table_1___prop_1
- FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS posthog_test_test_table_1) AS e__posthog_test_test_table_1 ON equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.person_properties.^email)), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), e__posthog_test_test_table_1.e__posthog_test_test_table_1___prop_1)
+ FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS posthog_test_test_table_1) AS e__posthog_test_test_table_1 ON equals(if(notEquals(toJSONString(e.person_properties.^email), '{}'), toJSONString(e.person_properties.^email), if(isNull(nullIf(toString(e.person_properties.email), '')), NULL, if(and(in(ascii(toString(e.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(e.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.person_properties.email), '[]'), '{}'), toString(e.person_properties.email)))), e__posthog_test_test_table_1.e__posthog_test_test_table_1___prop_1)
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime('2022-12-01 00:00:00', 'UTC')), toIntervalDay(1)), 6, 'UTC')), lessOrEquals(e.timestamp, assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.event, '$pageview'), equals(e__posthog_test_test_table_1.id, 'false'))
GROUP BY day_start)
GROUP BY day_start
@@ -86,7 +88,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestTrendsDataWarehouseQuery.test_trends_events_filtering_on_warehouse_person_property[new_events_schema]
@@ -107,6 +110,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_query_builder.new_events_schema.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_query_builder.new_events_schema.ambr
index 743e9768767b..a9c43aa74aee 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_query_builder.new_events_schema.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_query_builder.new_events_schema.ambr
@@ -31,7 +31,7 @@
FROM
(SELECT count() AS total,
toStartOfDay(toTimeZone(e.timestamp, %(hogql_val_0)s)) AS day_start,
- ifNull(nullIf(leftUTF8(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^bucket)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(e.properties.^bucket)), if(isNull(nullIf(toString(e.properties.bucket), '')), NULL, if(and(in(ascii(toString(e.properties.bucket)), tuple(91, 123)), in(ascii(toJSONString(e.properties.bucket)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.bucket), '[]'), '{}'), toString(e.properties.bucket))))), 400), %(hogql_val_1)s), %(hogql_val_2)s) AS breakdown_value
+ ifNull(nullIf(leftUTF8(toString(if(notEquals(toJSONString(e.properties.^bucket), '{}'), toJSONString(e.properties.^bucket), if(isNull(nullIf(toString(e.properties.bucket), '')), NULL, if(and(in(ascii(toString(e.properties.bucket)), tuple(91, 123)), in(ascii(toJSONString(e.properties.bucket)), tuple(91, 123))), nullIf(nullIf(toJSONString(e.properties.bucket), '[]'), '{}'), toString(e.properties.bucket))))), 400), %(hogql_val_1)s), %(hogql_val_2)s) AS breakdown_value
FROM events_json AS e
WHERE and(equals(e.team_id, 99999), greaterOrEquals(e.timestamp, toDateTime64(toStartOfInterval(assumeNotNull(toDateTime(%(hogql_val_3)s, %(hogql_val_4)s)), toIntervalDay(1)), 6, %(hogql_val_5)s)), lessOrEquals(e.timestamp, assumeNotNull(toDateTime(%(hogql_val_6)s, %(hogql_val_7)s))), equals(e.event, %(hogql_val_8)s))
GROUP BY day_start,
@@ -57,6 +57,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/revenue_analytics/backend/views/test/__snapshots__/test_mrr_views.new_events_schema.ambr b/products/revenue_analytics/backend/views/test/__snapshots__/test_mrr_views.new_events_schema.ambr
index dcb1baadf795..1f9a2e693922 100644
--- a/products/revenue_analytics/backend/views/test/__snapshots__/test_mrr_views.new_events_schema.ambr
+++ b/products/revenue_analytics/backend/views/test/__snapshots__/test_mrr_views.new_events_schema.ambr
@@ -19,8 +19,8 @@
'revenue_analytics.events.purchase' AS source_label,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription))))) AS is_recurring,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product)))) AS product_id,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription))))) AS is_recurring,
+ if(notEquals(toJSONString(events.properties.^product), '{}'), toJSONString(events.properties.^product), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product)))) AS product_id,
toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
events.properties.`$group_0` AS group_0_key,
events.properties.`$group_1` AS group_1_key,
@@ -28,18 +28,18 @@
events.properties.`$group_3` AS group_3_key,
events.properties.`$group_4` AS group_4_key,
NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
+ if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
toString(events.properties.`$session_id`) AS session_id,
events.event AS event_name,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^coupon)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^coupon)), if(isNull(nullIf(toString(events.properties.coupon), '')), NULL, if(and(in(ascii(toString(events.properties.coupon)), tuple(91, 123)), in(ascii(toJSONString(events.properties.coupon)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.coupon), '[]'), '{}'), toString(events.properties.coupon)))) AS coupon,
+ if(notEquals(toJSONString(events.properties.^coupon), '{}'), toJSONString(events.properties.^coupon), if(isNull(nullIf(toString(events.properties.coupon), '')), NULL, if(and(in(ascii(toString(events.properties.coupon)), tuple(91, 123)), in(ascii(toJSONString(events.properties.coupon)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.coupon), '[]'), '{}'), toString(events.properties.coupon)))) AS coupon,
coupon AS coupon_id,
- upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))) AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))) AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
1 AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount,
'GBP' AS currency,
- if(isNull(upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency)))))), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals(upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ if(isNull(upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency)))))), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals(upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -72,8 +72,8 @@
NULL AS metadata
FROM
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
- min(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product))))) AS product_id,
+ if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
+ min(if(notEquals(toJSONString(events.properties.^product), '{}'), toJSONString(events.properties.^product), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product))))) AS product_id,
min(toTimeZone(events.timestamp, 'UTC')) AS min_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS max_timestamp,
addDays(max_timestamp, 45.0) AS max_timestamp_plus_dropoff_days
@@ -110,7 +110,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestMRRViewsE2E.test_query_output_events[new_events_schema]
@@ -136,8 +137,8 @@
'revenue_analytics.events.purchase' AS source_label,
toTimeZone(events.timestamp, 'UTC') AS timestamp,
timestamp AS created_at,
- isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription))))) AS is_recurring,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product)))) AS product_id,
+ isNotNull(if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription))))) AS is_recurring,
+ if(notEquals(toJSONString(events.properties.^product), '{}'), toJSONString(events.properties.^product), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product)))) AS product_id,
toString(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS customer_id,
events.properties.`$group_0` AS group_0_key,
events.properties.`$group_1` AS group_1_key,
@@ -145,18 +146,18 @@
events.properties.`$group_3` AS group_3_key,
events.properties.`$group_4` AS group_4_key,
NULL AS invoice_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
+ if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
toString(events.properties.`$session_id`) AS session_id,
events.event AS event_name,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^coupon)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^coupon)), if(isNull(nullIf(toString(events.properties.coupon), '')), NULL, if(and(in(ascii(toString(events.properties.coupon)), tuple(91, 123)), in(ascii(toJSONString(events.properties.coupon)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.coupon), '[]'), '{}'), toString(events.properties.coupon)))) AS coupon,
+ if(notEquals(toJSONString(events.properties.^coupon), '{}'), toJSONString(events.properties.^coupon), if(isNull(nullIf(toString(events.properties.coupon), '')), NULL, if(and(in(ascii(toString(events.properties.coupon)), tuple(91, 123)), in(ascii(toJSONString(events.properties.coupon)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.coupon), '[]'), '{}'), toString(events.properties.coupon)))) AS coupon,
coupon AS coupon_id,
- upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))) AS original_currency,
- accurateCastOrNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^revenue)), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
+ upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))) AS original_currency,
+ accurateCastOrNull(if(notEquals(toJSONString(events.properties.^revenue), '{}'), toJSONString(events.properties.^revenue), if(isNull(nullIf(toString(events.properties.revenue), '')), NULL, if(and(in(ascii(toString(events.properties.revenue)), tuple(91, 123)), in(ascii(toJSONString(events.properties.revenue)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.revenue), '[]'), '{}'), toString(events.properties.revenue)))), 'Decimal64(10)') AS original_amount,
1 AS enable_currency_aware_divider,
if(enable_currency_aware_divider, accurateCastOrNull(1, 'Decimal64(10)'), accurateCastOrNull(100, 'Decimal64(10)')) AS currency_aware_divider,
divideDecimal(original_amount, currency_aware_divider) AS currency_aware_amount,
'GBP' AS currency,
- if(isNull(upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency)))))), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals(upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^currency)), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
+ if(isNull(upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency)))))), accurateCastOrNull(currency_aware_amount, 'Decimal64(10)'), if(equals(upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), 'GBP'), toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(0, 10), multiplyDecimal(divideDecimal(toDecimal128(currency_aware_amount, 10), if(ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)) = 0, toDecimal128(1, 10), ifNull(dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', upper(if(notEquals(toJSONString(events.properties.^currency), '{}'), toJSONString(events.properties.^currency), if(isNull(nullIf(toString(events.properties.currency), '')), NULL, if(and(in(ascii(toString(events.properties.currency)), tuple(91, 123)), in(ascii(toJSONString(events.properties.currency)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.currency), '[]'), '{}'), toString(events.properties.currency))))), toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)), toDecimal64(0, 10)))), dictGetOrDefault(`posthog_test`.`exchange_rate_dict`, 'rate', 'GBP', toDate(toTimeZone(events.timestamp, 'UTC')), toDecimal64(0, 10)))))) AS amount
FROM events_json AS events
LEFT OUTER JOIN
(SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id,
@@ -189,8 +190,8 @@
NULL AS metadata
FROM
(SELECT if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id) AS person_id,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^subscription)), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
- min(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^product)), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product))))) AS product_id,
+ if(notEquals(toJSONString(events.properties.^subscription), '{}'), toJSONString(events.properties.^subscription), if(isNull(nullIf(toString(events.properties.subscription), '')), NULL, if(and(in(ascii(toString(events.properties.subscription)), tuple(91, 123)), in(ascii(toJSONString(events.properties.subscription)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.subscription), '[]'), '{}'), toString(events.properties.subscription)))) AS subscription_id,
+ min(if(notEquals(toJSONString(events.properties.^product), '{}'), toJSONString(events.properties.^product), if(isNull(nullIf(toString(events.properties.product), '')), NULL, if(and(in(ascii(toString(events.properties.product)), tuple(91, 123)), in(ascii(toJSONString(events.properties.product)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.product), '[]'), '{}'), toString(events.properties.product))))) AS product_id,
min(toTimeZone(events.timestamp, 'UTC')) AS min_timestamp,
max(toTimeZone(events.timestamp, 'UTC')) AS max_timestamp,
addDays(max_timestamp, 45.0) AS max_timestamp_plus_dropoff_days
@@ -227,6 +228,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/surveys/backend/api/test/__snapshots__/test_survey.new_events_schema.ambr b/products/surveys/backend/api/test/__snapshots__/test_survey.new_events_schema.ambr
index c838ac73ce71..c200aa5861fb 100644
--- a/products/surveys/backend/api/test/__snapshots__/test_survey.new_events_schema.ambr
+++ b/products/surveys/backend/api/test/__snapshots__/test_survey.new_events_schema.ambr
@@ -2,14 +2,14 @@
# name: TestResponsesCount.test_responses_count[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-01-21 14:40:09.000000', 6, 'UTC')), globalIn(events.uuid,
- (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-01-21 14:40:09.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-01-21 14:40:09.000000', 6, 'UTC')), globalIn(events.uuid,
+ (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-01-21 14:40:09.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
GROUP BY survey_id
LIMIT 50000 SETTINGS readonly=2,
max_execution_time=60,
@@ -23,20 +23,21 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestResponsesCount.test_responses_count_only_after_first_survey_started[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-04-25 14:40:09.000000', 6, 'UTC')), globalIn(events.uuid,
- (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-04-25 14:40:09.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-04-25 14:40:09.000000', 6, 'UTC')), globalIn(events.uuid,
+ (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-04-25 14:40:09.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
GROUP BY survey_id
LIMIT 50000 SETTINGS readonly=2,
max_execution_time=60,
@@ -50,20 +51,21 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestResponsesCount.test_responses_count_with_partial_responses[new_events_schema]
'''
/* user_id:0 request:_snapshot_ */
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
+ SELECT if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))) AS survey_id,
count() AS `count()`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-06-10 11:00:00.000000', 6, 'UTC')), globalIn(events.uuid,
- (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
- FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_partially_completed`)), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-06-10 11:00:00.000000', 6, 'UTC')))
- GROUP BY if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_id`)), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$survey_submission_id`)), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-06-10 11:00:00.000000', 6, 'UTC')), globalIn(events.uuid,
+ (SELECT argMax(events.uuid, tuple(toTimeZone(events.timestamp, 'UTC'), events.uuid)) AS `argMax(uuid, tuple(toTimeZone(timestamp, 'UTC'), uuid))`
+ FROM events_json AS events
+ WHERE and(equals(events.team_id, 99999), or(equals(events.event, 'survey sent'), and(in(events.event, tuple('survey dismissed', 'survey abandoned')), equals(coalesce(JSONExtractString(ifNull(if(notEquals(toJSONString(events.properties.^`$survey_partially_completed`), '{}'), toJSONString(events.properties.^`$survey_partially_completed`), if(isNull(nullIf(toString(events.properties.`$survey_partially_completed`), '')), NULL, nullIf(nullIf(toJSONString(events.properties.`$survey_partially_completed`), '[]'), '{}'))), '')), ''), 'true'))), greaterOrEquals(events.timestamp, toDateTime64('2024-06-10 11:00:00.000000', 6, 'UTC')))
+ GROUP BY if(notEquals(toJSONString(events.properties.^`$survey_id`), '{}'), toJSONString(events.properties.^`$survey_id`), if(isNull(nullIf(toString(events.properties.`$survey_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_id`), '[]'), '{}'), toString(events.properties.`$survey_id`)))), if(ifNull(equals(coalesce(if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`)))), ''), ''), 0), toString(events.uuid), if(notEquals(toJSONString(events.properties.^`$survey_submission_id`), '{}'), toJSONString(events.properties.^`$survey_submission_id`), if(isNull(nullIf(toString(events.properties.`$survey_submission_id`), '')), NULL, if(and(in(ascii(toString(events.properties.`$survey_submission_id`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$survey_submission_id`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$survey_submission_id`), '[]'), '{}'), toString(events.properties.`$survey_submission_id`))))))))
GROUP BY survey_id
LIMIT 50000 SETTINGS readonly=2,
max_execution_time=60,
@@ -77,6 +79,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
index b4629d25f0c6..c1014cccdd5a 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_external_clicks_table.new_events_schema.ambr
@@ -7,7 +7,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -23,8 +23,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -43,7 +43,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_all_time[new_events_schema]
@@ -64,7 +65,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_custom_order_by[new_events_schema.1]
@@ -75,7 +77,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -91,8 +93,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -111,7 +113,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_custom_order_by[new_events_schema]
@@ -122,7 +125,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -138,8 +141,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -158,7 +161,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_dont_filter_test_accounts[new_events_schema]
@@ -169,7 +173,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -185,8 +189,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -205,7 +209,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_filter_test_accounts[new_events_schema]
@@ -216,7 +221,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -232,8 +237,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), ifNull(notILike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -252,7 +257,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_increase_in_users[new_events_schema]
@@ -263,7 +269,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -279,8 +285,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-11 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -299,7 +305,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_no_crash_when_no_data[new_events_schema]
@@ -310,7 +317,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -326,8 +333,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -346,7 +353,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_path_cleaning[new_events_schema.1]
@@ -357,7 +365,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -373,8 +381,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -393,7 +401,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_path_cleaning[new_events_schema]
@@ -404,7 +413,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))), '/items/\\d+', '/items/:id') AS url,
+ replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))), '/items/\\d+', '/items/:id') AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -420,8 +429,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -440,7 +449,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_should_exclude_subdomain_under_root[new_events_schema]
@@ -451,7 +461,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -467,8 +477,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -487,7 +497,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_should_exclude_subdomain_with_shared_root[new_events_schema]
@@ -498,7 +509,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -514,8 +525,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -534,7 +545,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_strip_query_params[new_events_schema.1]
@@ -545,7 +557,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
+ if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`)))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -561,8 +573,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -581,7 +593,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestExternalClicksTableQueryRunner.test_strip_query_params[new_events_schema]
@@ -592,7 +605,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_click_count,
- cutQueryStringAndFragment(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))) AS url,
+ cutQueryStringAndFragment(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))) AS url,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN
@@ -608,8 +621,8 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$event_type`)), if(isNull(nullIf(toString(events.properties.`$event_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$event_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$event_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$event_type`), '[]'), '{}'), toString(events.properties.`$event_type`)))), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$external_click_url`)), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
- or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$autocapture'), ifNull(equals(CAST(events.properties.`$event_type`, 'Nullable(String)'), 'click'), 0), isNotNull(url), ifNull(notEquals(url, ''), 1), ifNull(notEquals(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))), cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`)))))), isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$external_click_url`), '{}'), toJSONString(events.properties.^`$external_click_url`), if(isNull(nullIf(toString(events.properties.`$external_click_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$external_click_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$external_click_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$external_click_url`), '[]'), '{}'), toString(events.properties.`$external_click_url`))))))
+ or isNotNull(cutToFirstSignificantSubdomain(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
GROUP BY events.properties.`$session_id`,
url)
GROUP BY `context.columns.url`
@@ -628,6 +641,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
index 39b3e5b70141..99ff63e00687 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_notable_changes.new_events_schema.ambr
@@ -18,12 +18,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -68,10 +68,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -240,12 +240,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -290,10 +290,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -316,12 +316,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -366,10 +366,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -392,12 +392,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -442,10 +442,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -636,7 +636,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebNotableChangesQueryRunner.test_integration_with_events[new_events_schema.1]
@@ -658,12 +659,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -708,10 +709,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -880,12 +881,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -930,10 +931,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -956,12 +957,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1006,10 +1007,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1032,12 +1033,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1082,10 +1083,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1276,7 +1277,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebNotableChangesQueryRunner.test_integration_with_events[new_events_schema]
@@ -1298,12 +1300,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1348,10 +1350,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1520,12 +1522,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1570,10 +1572,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1596,12 +1598,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1646,10 +1648,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1672,12 +1674,12 @@
FROM (
SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id,
events.person_id)) AS person_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
- events__session.session_id AS session_id,
- min(events__session.`$start_timestamp`) AS start_timestamp
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null') AS dimension_value,
+ events__session.session_id AS session_id,
+ min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
LEFT JOIN (
SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7,
@@ -1722,10 +1724,10 @@
'UTC'), assumeNotNull(toDateTime('2025-01-22 23:59:59',
'UTC'))))), 1))
GROUP BY events__session.session_id,
- nullIf(nullIf(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
- if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
- 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
- 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
+ nullIf(nullIf(if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL,
+ if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91,
+ 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))), ''), 'null'))
GROUP BY dimension_value
HAVING and(isNotNull(dimension_value), ifNull(notEquals(dimension_value,
''), 1))
@@ -1916,6 +1918,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.new_events_schema.ambr
index a682663fc4d2..0b08a4468c94 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_traffic_type_snapshot.new_events_schema.ambr
@@ -4,15 +4,15 @@
-- ClickHouse
SELECT
events.event AS event,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))) AS user_agent
+ if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))) AS user_agent
FROM
events_json AS events
WHERE
- and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_0)s), not(accurateCastOrNull(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_1)s), [%(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s, %(hogql_val_345)s]), 0), 1), %(hogql_val_346)s)))
+ and(equals(events.team_id, 99999), equals(events.event, %(hogql_val_0)s), not(accurateCastOrNull(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_1)s), [%(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s, %(hogql_val_345)s]), 0), 1), %(hogql_val_346)s)))
ORDER BY
user_agent ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
@@ -31,7 +31,7 @@
'''
-- ClickHouse
SELECT
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS bot_name,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS bot_name,
count() AS count
FROM
events_json AS events
@@ -42,7 +42,7 @@
ORDER BY
bot_name ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
@@ -63,7 +63,7 @@
'''
-- ClickHouse
SELECT
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS bot_type,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS bot_type,
count() AS count
FROM
events_json AS events
@@ -74,7 +74,7 @@
ORDER BY
bot_type ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
@@ -95,7 +95,7 @@
'''
-- ClickHouse
SELECT
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS category,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS category,
count() AS count
FROM
events_json AS events
@@ -106,7 +106,7 @@
ORDER BY
category ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
@@ -127,7 +127,7 @@
'''
-- ClickHouse
SELECT
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS traffic_type,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 0), %(hogql_val_345)s, [%(hogql_val_346)s, %(hogql_val_347)s, %(hogql_val_348)s, %(hogql_val_349)s, %(hogql_val_350)s, %(hogql_val_351)s, %(hogql_val_352)s, %(hogql_val_353)s, %(hogql_val_354)s, %(hogql_val_355)s, %(hogql_val_356)s, %(hogql_val_357)s, %(hogql_val_358)s, %(hogql_val_359)s, %(hogql_val_360)s, %(hogql_val_361)s, %(hogql_val_362)s, %(hogql_val_363)s, %(hogql_val_364)s, %(hogql_val_365)s, %(hogql_val_366)s, %(hogql_val_367)s, %(hogql_val_368)s, %(hogql_val_369)s, %(hogql_val_370)s, %(hogql_val_371)s, %(hogql_val_372)s, %(hogql_val_373)s, %(hogql_val_374)s, %(hogql_val_375)s, %(hogql_val_376)s, %(hogql_val_377)s, %(hogql_val_378)s, %(hogql_val_379)s, %(hogql_val_380)s, %(hogql_val_381)s, %(hogql_val_382)s, %(hogql_val_383)s, %(hogql_val_384)s, %(hogql_val_385)s, %(hogql_val_386)s, %(hogql_val_387)s, %(hogql_val_388)s, %(hogql_val_389)s, %(hogql_val_390)s, %(hogql_val_391)s, %(hogql_val_392)s, %(hogql_val_393)s, %(hogql_val_394)s, %(hogql_val_395)s, %(hogql_val_396)s, %(hogql_val_397)s, %(hogql_val_398)s, %(hogql_val_399)s, %(hogql_val_400)s, %(hogql_val_401)s, %(hogql_val_402)s, %(hogql_val_403)s, %(hogql_val_404)s, %(hogql_val_405)s, %(hogql_val_406)s, %(hogql_val_407)s, %(hogql_val_408)s, %(hogql_val_409)s, %(hogql_val_410)s, %(hogql_val_411)s, %(hogql_val_412)s, %(hogql_val_413)s, %(hogql_val_414)s, %(hogql_val_415)s, %(hogql_val_416)s, %(hogql_val_417)s, %(hogql_val_418)s, %(hogql_val_419)s, %(hogql_val_420)s, %(hogql_val_421)s, %(hogql_val_422)s, %(hogql_val_423)s, %(hogql_val_424)s, %(hogql_val_425)s, %(hogql_val_426)s, %(hogql_val_427)s, %(hogql_val_428)s, %(hogql_val_429)s, %(hogql_val_430)s, %(hogql_val_431)s, %(hogql_val_432)s, %(hogql_val_433)s, %(hogql_val_434)s, %(hogql_val_435)s, %(hogql_val_436)s, %(hogql_val_437)s, %(hogql_val_438)s, %(hogql_val_439)s, %(hogql_val_440)s, %(hogql_val_441)s, %(hogql_val_442)s, %(hogql_val_443)s, %(hogql_val_444)s, %(hogql_val_445)s, %(hogql_val_446)s, %(hogql_val_447)s, %(hogql_val_448)s, %(hogql_val_449)s, %(hogql_val_450)s, %(hogql_val_451)s, %(hogql_val_452)s, %(hogql_val_453)s, %(hogql_val_454)s, %(hogql_val_455)s, %(hogql_val_456)s, %(hogql_val_457)s, %(hogql_val_458)s, %(hogql_val_459)s, %(hogql_val_460)s, %(hogql_val_461)s, %(hogql_val_462)s, %(hogql_val_463)s, %(hogql_val_464)s, %(hogql_val_465)s, %(hogql_val_466)s, %(hogql_val_467)s, %(hogql_val_468)s, %(hogql_val_469)s, %(hogql_val_470)s, %(hogql_val_471)s, %(hogql_val_472)s, %(hogql_val_473)s, %(hogql_val_474)s, %(hogql_val_475)s, %(hogql_val_476)s, %(hogql_val_477)s, %(hogql_val_478)s, %(hogql_val_479)s, %(hogql_val_480)s, %(hogql_val_481)s, %(hogql_val_482)s, %(hogql_val_483)s, %(hogql_val_484)s, %(hogql_val_485)s, %(hogql_val_486)s, %(hogql_val_487)s, %(hogql_val_488)s, %(hogql_val_489)s, %(hogql_val_490)s, %(hogql_val_491)s, %(hogql_val_492)s, %(hogql_val_493)s, %(hogql_val_494)s, %(hogql_val_495)s, %(hogql_val_496)s, %(hogql_val_497)s, %(hogql_val_498)s, %(hogql_val_499)s, %(hogql_val_500)s, %(hogql_val_501)s, %(hogql_val_502)s, %(hogql_val_503)s, %(hogql_val_504)s, %(hogql_val_505)s, %(hogql_val_506)s, %(hogql_val_507)s, %(hogql_val_508)s, %(hogql_val_509)s, %(hogql_val_510)s, %(hogql_val_511)s, %(hogql_val_512)s, %(hogql_val_513)s, %(hogql_val_514)s, %(hogql_val_515)s, %(hogql_val_516)s, %(hogql_val_517)s, %(hogql_val_518)s, %(hogql_val_519)s, %(hogql_val_520)s, %(hogql_val_521)s, %(hogql_val_522)s, %(hogql_val_523)s, %(hogql_val_524)s, %(hogql_val_525)s, %(hogql_val_526)s, %(hogql_val_527)s, %(hogql_val_528)s, %(hogql_val_529)s, %(hogql_val_530)s, %(hogql_val_531)s, %(hogql_val_532)s, %(hogql_val_533)s, %(hogql_val_534)s, %(hogql_val_535)s, %(hogql_val_536)s, %(hogql_val_537)s, %(hogql_val_538)s, %(hogql_val_539)s, %(hogql_val_540)s, %(hogql_val_541)s, %(hogql_val_542)s, %(hogql_val_543)s, %(hogql_val_544)s, %(hogql_val_545)s, %(hogql_val_546)s, %(hogql_val_547)s, %(hogql_val_548)s, %(hogql_val_549)s, %(hogql_val_550)s, %(hogql_val_551)s, %(hogql_val_552)s, %(hogql_val_553)s, %(hogql_val_554)s, %(hogql_val_555)s, %(hogql_val_556)s, %(hogql_val_557)s, %(hogql_val_558)s, %(hogql_val_559)s, %(hogql_val_560)s, %(hogql_val_561)s, %(hogql_val_562)s, %(hogql_val_563)s, %(hogql_val_564)s, %(hogql_val_565)s, %(hogql_val_566)s, %(hogql_val_567)s, %(hogql_val_568)s, %(hogql_val_569)s, %(hogql_val_570)s, %(hogql_val_571)s, %(hogql_val_572)s, %(hogql_val_573)s, %(hogql_val_574)s, %(hogql_val_575)s, %(hogql_val_576)s, %(hogql_val_577)s, %(hogql_val_578)s, %(hogql_val_579)s, %(hogql_val_580)s, %(hogql_val_581)s, %(hogql_val_582)s, %(hogql_val_583)s, %(hogql_val_584)s, %(hogql_val_585)s, %(hogql_val_586)s, %(hogql_val_587)s, %(hogql_val_588)s, %(hogql_val_589)s, %(hogql_val_590)s, %(hogql_val_591)s, %(hogql_val_592)s, %(hogql_val_593)s, %(hogql_val_594)s, %(hogql_val_595)s, %(hogql_val_596)s, %(hogql_val_597)s, %(hogql_val_598)s, %(hogql_val_599)s, %(hogql_val_600)s, %(hogql_val_601)s, %(hogql_val_602)s, %(hogql_val_603)s, %(hogql_val_604)s, %(hogql_val_605)s, %(hogql_val_606)s, %(hogql_val_607)s, %(hogql_val_608)s, %(hogql_val_609)s, %(hogql_val_610)s, %(hogql_val_611)s, %(hogql_val_612)s, %(hogql_val_613)s, %(hogql_val_614)s, %(hogql_val_615)s, %(hogql_val_616)s, %(hogql_val_617)s, %(hogql_val_618)s, %(hogql_val_619)s, %(hogql_val_620)s, %(hogql_val_621)s, %(hogql_val_622)s, %(hogql_val_623)s, %(hogql_val_624)s, %(hogql_val_625)s, %(hogql_val_626)s, %(hogql_val_627)s, %(hogql_val_628)s, %(hogql_val_629)s, %(hogql_val_630)s, %(hogql_val_631)s, %(hogql_val_632)s, %(hogql_val_633)s, %(hogql_val_634)s, %(hogql_val_635)s, %(hogql_val_636)s, %(hogql_val_637)s, %(hogql_val_638)s, %(hogql_val_639)s, %(hogql_val_640)s, %(hogql_val_641)s, %(hogql_val_642)s, %(hogql_val_643)s, %(hogql_val_644)s, %(hogql_val_645)s, %(hogql_val_646)s, %(hogql_val_647)s, %(hogql_val_648)s, %(hogql_val_649)s, %(hogql_val_650)s, %(hogql_val_651)s, %(hogql_val_652)s, %(hogql_val_653)s, %(hogql_val_654)s, %(hogql_val_655)s, %(hogql_val_656)s, %(hogql_val_657)s, %(hogql_val_658)s, %(hogql_val_659)s, %(hogql_val_660)s, %(hogql_val_661)s, %(hogql_val_662)s, %(hogql_val_663)s, %(hogql_val_664)s, %(hogql_val_665)s, %(hogql_val_666)s, %(hogql_val_667)s, %(hogql_val_668)s, %(hogql_val_669)s, %(hogql_val_670)s, %(hogql_val_671)s, %(hogql_val_672)s, %(hogql_val_673)s, %(hogql_val_674)s, %(hogql_val_675)s, %(hogql_val_676)s, %(hogql_val_677)s, %(hogql_val_678)s, %(hogql_val_679)s, %(hogql_val_680)s, %(hogql_val_681)s, %(hogql_val_682)s, %(hogql_val_683)s, %(hogql_val_684)s, %(hogql_val_685)s, %(hogql_val_686)s, %(hogql_val_687)s, %(hogql_val_688)s, %(hogql_val_689)s][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_690)s), [%(hogql_val_691)s, %(hogql_val_692)s, %(hogql_val_693)s, %(hogql_val_694)s, %(hogql_val_695)s, %(hogql_val_696)s, %(hogql_val_697)s, %(hogql_val_698)s, %(hogql_val_699)s, %(hogql_val_700)s, %(hogql_val_701)s, %(hogql_val_702)s, %(hogql_val_703)s, %(hogql_val_704)s, %(hogql_val_705)s, %(hogql_val_706)s, %(hogql_val_707)s, %(hogql_val_708)s, %(hogql_val_709)s, %(hogql_val_710)s, %(hogql_val_711)s, %(hogql_val_712)s, %(hogql_val_713)s, %(hogql_val_714)s, %(hogql_val_715)s, %(hogql_val_716)s, %(hogql_val_717)s, %(hogql_val_718)s, %(hogql_val_719)s, %(hogql_val_720)s, %(hogql_val_721)s, %(hogql_val_722)s, %(hogql_val_723)s, %(hogql_val_724)s, %(hogql_val_725)s, %(hogql_val_726)s, %(hogql_val_727)s, %(hogql_val_728)s, %(hogql_val_729)s, %(hogql_val_730)s, %(hogql_val_731)s, %(hogql_val_732)s, %(hogql_val_733)s, %(hogql_val_734)s, %(hogql_val_735)s, %(hogql_val_736)s, %(hogql_val_737)s, %(hogql_val_738)s, %(hogql_val_739)s, %(hogql_val_740)s, %(hogql_val_741)s, %(hogql_val_742)s, %(hogql_val_743)s, %(hogql_val_744)s, %(hogql_val_745)s, %(hogql_val_746)s, %(hogql_val_747)s, %(hogql_val_748)s, %(hogql_val_749)s, %(hogql_val_750)s, %(hogql_val_751)s, %(hogql_val_752)s, %(hogql_val_753)s, %(hogql_val_754)s, %(hogql_val_755)s, %(hogql_val_756)s, %(hogql_val_757)s, %(hogql_val_758)s, %(hogql_val_759)s, %(hogql_val_760)s, %(hogql_val_761)s, %(hogql_val_762)s, %(hogql_val_763)s, %(hogql_val_764)s, %(hogql_val_765)s, %(hogql_val_766)s, %(hogql_val_767)s, %(hogql_val_768)s, %(hogql_val_769)s, %(hogql_val_770)s, %(hogql_val_771)s, %(hogql_val_772)s, %(hogql_val_773)s, %(hogql_val_774)s, %(hogql_val_775)s, %(hogql_val_776)s, %(hogql_val_777)s, %(hogql_val_778)s, %(hogql_val_779)s, %(hogql_val_780)s, %(hogql_val_781)s, %(hogql_val_782)s, %(hogql_val_783)s, %(hogql_val_784)s, %(hogql_val_785)s, %(hogql_val_786)s, %(hogql_val_787)s, %(hogql_val_788)s, %(hogql_val_789)s, %(hogql_val_790)s, %(hogql_val_791)s, %(hogql_val_792)s, %(hogql_val_793)s, %(hogql_val_794)s, %(hogql_val_795)s, %(hogql_val_796)s, %(hogql_val_797)s, %(hogql_val_798)s, %(hogql_val_799)s, %(hogql_val_800)s, %(hogql_val_801)s, %(hogql_val_802)s, %(hogql_val_803)s, %(hogql_val_804)s, %(hogql_val_805)s, %(hogql_val_806)s, %(hogql_val_807)s, %(hogql_val_808)s, %(hogql_val_809)s, %(hogql_val_810)s, %(hogql_val_811)s, %(hogql_val_812)s, %(hogql_val_813)s, %(hogql_val_814)s, %(hogql_val_815)s, %(hogql_val_816)s, %(hogql_val_817)s, %(hogql_val_818)s, %(hogql_val_819)s, %(hogql_val_820)s, %(hogql_val_821)s, %(hogql_val_822)s, %(hogql_val_823)s, %(hogql_val_824)s, %(hogql_val_825)s, %(hogql_val_826)s, %(hogql_val_827)s, %(hogql_val_828)s, %(hogql_val_829)s, %(hogql_val_830)s, %(hogql_val_831)s, %(hogql_val_832)s, %(hogql_val_833)s, %(hogql_val_834)s, %(hogql_val_835)s, %(hogql_val_836)s, %(hogql_val_837)s, %(hogql_val_838)s, %(hogql_val_839)s, %(hogql_val_840)s, %(hogql_val_841)s, %(hogql_val_842)s, %(hogql_val_843)s, %(hogql_val_844)s, %(hogql_val_845)s, %(hogql_val_846)s, %(hogql_val_847)s, %(hogql_val_848)s, %(hogql_val_849)s, %(hogql_val_850)s, %(hogql_val_851)s, %(hogql_val_852)s, %(hogql_val_853)s, %(hogql_val_854)s, %(hogql_val_855)s, %(hogql_val_856)s, %(hogql_val_857)s, %(hogql_val_858)s, %(hogql_val_859)s, %(hogql_val_860)s, %(hogql_val_861)s, %(hogql_val_862)s, %(hogql_val_863)s, %(hogql_val_864)s, %(hogql_val_865)s, %(hogql_val_866)s, %(hogql_val_867)s, %(hogql_val_868)s, %(hogql_val_869)s, %(hogql_val_870)s, %(hogql_val_871)s, %(hogql_val_872)s, %(hogql_val_873)s, %(hogql_val_874)s, %(hogql_val_875)s, %(hogql_val_876)s, %(hogql_val_877)s, %(hogql_val_878)s, %(hogql_val_879)s, %(hogql_val_880)s, %(hogql_val_881)s, %(hogql_val_882)s, %(hogql_val_883)s, %(hogql_val_884)s, %(hogql_val_885)s, %(hogql_val_886)s, %(hogql_val_887)s, %(hogql_val_888)s, %(hogql_val_889)s, %(hogql_val_890)s, %(hogql_val_891)s, %(hogql_val_892)s, %(hogql_val_893)s, %(hogql_val_894)s, %(hogql_val_895)s, %(hogql_val_896)s, %(hogql_val_897)s, %(hogql_val_898)s, %(hogql_val_899)s, %(hogql_val_900)s, %(hogql_val_901)s, %(hogql_val_902)s, %(hogql_val_903)s, %(hogql_val_904)s, %(hogql_val_905)s, %(hogql_val_906)s, %(hogql_val_907)s, %(hogql_val_908)s, %(hogql_val_909)s, %(hogql_val_910)s, %(hogql_val_911)s, %(hogql_val_912)s, %(hogql_val_913)s, %(hogql_val_914)s, %(hogql_val_915)s, %(hogql_val_916)s, %(hogql_val_917)s, %(hogql_val_918)s, %(hogql_val_919)s, %(hogql_val_920)s, %(hogql_val_921)s, %(hogql_val_922)s, %(hogql_val_923)s, %(hogql_val_924)s, %(hogql_val_925)s, %(hogql_val_926)s, %(hogql_val_927)s, %(hogql_val_928)s, %(hogql_val_929)s, %(hogql_val_930)s, %(hogql_val_931)s, %(hogql_val_932)s, %(hogql_val_933)s, %(hogql_val_934)s, %(hogql_val_935)s, %(hogql_val_936)s, %(hogql_val_937)s, %(hogql_val_938)s, %(hogql_val_939)s, %(hogql_val_940)s, %(hogql_val_941)s, %(hogql_val_942)s, %(hogql_val_943)s, %(hogql_val_944)s, %(hogql_val_945)s, %(hogql_val_946)s, %(hogql_val_947)s, %(hogql_val_948)s, %(hogql_val_949)s, %(hogql_val_950)s, %(hogql_val_951)s, %(hogql_val_952)s, %(hogql_val_953)s, %(hogql_val_954)s, %(hogql_val_955)s, %(hogql_val_956)s, %(hogql_val_957)s, %(hogql_val_958)s, %(hogql_val_959)s, %(hogql_val_960)s, %(hogql_val_961)s, %(hogql_val_962)s, %(hogql_val_963)s, %(hogql_val_964)s, %(hogql_val_965)s, %(hogql_val_966)s, %(hogql_val_967)s, %(hogql_val_968)s, %(hogql_val_969)s, %(hogql_val_970)s, %(hogql_val_971)s, %(hogql_val_972)s, %(hogql_val_973)s, %(hogql_val_974)s, %(hogql_val_975)s, %(hogql_val_976)s, %(hogql_val_977)s, %(hogql_val_978)s, %(hogql_val_979)s, %(hogql_val_980)s, %(hogql_val_981)s, %(hogql_val_982)s, %(hogql_val_983)s, %(hogql_val_984)s, %(hogql_val_985)s, %(hogql_val_986)s, %(hogql_val_987)s, %(hogql_val_988)s, %(hogql_val_989)s, %(hogql_val_990)s, %(hogql_val_991)s, %(hogql_val_992)s, %(hogql_val_993)s, %(hogql_val_994)s, %(hogql_val_995)s, %(hogql_val_996)s, %(hogql_val_997)s, %(hogql_val_998)s, %(hogql_val_999)s, %(hogql_val_1000)s, %(hogql_val_1001)s, %(hogql_val_1002)s, %(hogql_val_1003)s, %(hogql_val_1004)s, %(hogql_val_1005)s, %(hogql_val_1006)s, %(hogql_val_1007)s, %(hogql_val_1008)s, %(hogql_val_1009)s, %(hogql_val_1010)s, %(hogql_val_1011)s, %(hogql_val_1012)s, %(hogql_val_1013)s, %(hogql_val_1014)s, %(hogql_val_1015)s, %(hogql_val_1016)s, %(hogql_val_1017)s, %(hogql_val_1018)s, %(hogql_val_1019)s, %(hogql_val_1020)s, %(hogql_val_1021)s, %(hogql_val_1022)s, %(hogql_val_1023)s, %(hogql_val_1024)s, %(hogql_val_1025)s, %(hogql_val_1026)s, %(hogql_val_1027)s, %(hogql_val_1028)s, %(hogql_val_1029)s, %(hogql_val_1030)s, %(hogql_val_1031)s, %(hogql_val_1032)s, %(hogql_val_1033)s, %(hogql_val_1034)s])]) AS traffic_type,
count() AS count
FROM
events_json AS events
@@ -138,7 +138,7 @@
ORDER BY
traffic_type ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
@@ -159,7 +159,7 @@
'''
-- ClickHouse
SELECT
- accurateCastOrNull(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$user_agent`)), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 1), %(hogql_val_345)s) AS is_bot,
+ accurateCastOrNull(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$user_agent`), '{}'), toJSONString(events.properties.^`$user_agent`), if(isNull(nullIf(toString(events.properties.`$user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$user_agent`), '[]'), '{}'), toString(events.properties.`$user_agent`)))), %(hogql_val_0)s), [%(hogql_val_1)s, %(hogql_val_2)s, %(hogql_val_3)s, %(hogql_val_4)s, %(hogql_val_5)s, %(hogql_val_6)s, %(hogql_val_7)s, %(hogql_val_8)s, %(hogql_val_9)s, %(hogql_val_10)s, %(hogql_val_11)s, %(hogql_val_12)s, %(hogql_val_13)s, %(hogql_val_14)s, %(hogql_val_15)s, %(hogql_val_16)s, %(hogql_val_17)s, %(hogql_val_18)s, %(hogql_val_19)s, %(hogql_val_20)s, %(hogql_val_21)s, %(hogql_val_22)s, %(hogql_val_23)s, %(hogql_val_24)s, %(hogql_val_25)s, %(hogql_val_26)s, %(hogql_val_27)s, %(hogql_val_28)s, %(hogql_val_29)s, %(hogql_val_30)s, %(hogql_val_31)s, %(hogql_val_32)s, %(hogql_val_33)s, %(hogql_val_34)s, %(hogql_val_35)s, %(hogql_val_36)s, %(hogql_val_37)s, %(hogql_val_38)s, %(hogql_val_39)s, %(hogql_val_40)s, %(hogql_val_41)s, %(hogql_val_42)s, %(hogql_val_43)s, %(hogql_val_44)s, %(hogql_val_45)s, %(hogql_val_46)s, %(hogql_val_47)s, %(hogql_val_48)s, %(hogql_val_49)s, %(hogql_val_50)s, %(hogql_val_51)s, %(hogql_val_52)s, %(hogql_val_53)s, %(hogql_val_54)s, %(hogql_val_55)s, %(hogql_val_56)s, %(hogql_val_57)s, %(hogql_val_58)s, %(hogql_val_59)s, %(hogql_val_60)s, %(hogql_val_61)s, %(hogql_val_62)s, %(hogql_val_63)s, %(hogql_val_64)s, %(hogql_val_65)s, %(hogql_val_66)s, %(hogql_val_67)s, %(hogql_val_68)s, %(hogql_val_69)s, %(hogql_val_70)s, %(hogql_val_71)s, %(hogql_val_72)s, %(hogql_val_73)s, %(hogql_val_74)s, %(hogql_val_75)s, %(hogql_val_76)s, %(hogql_val_77)s, %(hogql_val_78)s, %(hogql_val_79)s, %(hogql_val_80)s, %(hogql_val_81)s, %(hogql_val_82)s, %(hogql_val_83)s, %(hogql_val_84)s, %(hogql_val_85)s, %(hogql_val_86)s, %(hogql_val_87)s, %(hogql_val_88)s, %(hogql_val_89)s, %(hogql_val_90)s, %(hogql_val_91)s, %(hogql_val_92)s, %(hogql_val_93)s, %(hogql_val_94)s, %(hogql_val_95)s, %(hogql_val_96)s, %(hogql_val_97)s, %(hogql_val_98)s, %(hogql_val_99)s, %(hogql_val_100)s, %(hogql_val_101)s, %(hogql_val_102)s, %(hogql_val_103)s, %(hogql_val_104)s, %(hogql_val_105)s, %(hogql_val_106)s, %(hogql_val_107)s, %(hogql_val_108)s, %(hogql_val_109)s, %(hogql_val_110)s, %(hogql_val_111)s, %(hogql_val_112)s, %(hogql_val_113)s, %(hogql_val_114)s, %(hogql_val_115)s, %(hogql_val_116)s, %(hogql_val_117)s, %(hogql_val_118)s, %(hogql_val_119)s, %(hogql_val_120)s, %(hogql_val_121)s, %(hogql_val_122)s, %(hogql_val_123)s, %(hogql_val_124)s, %(hogql_val_125)s, %(hogql_val_126)s, %(hogql_val_127)s, %(hogql_val_128)s, %(hogql_val_129)s, %(hogql_val_130)s, %(hogql_val_131)s, %(hogql_val_132)s, %(hogql_val_133)s, %(hogql_val_134)s, %(hogql_val_135)s, %(hogql_val_136)s, %(hogql_val_137)s, %(hogql_val_138)s, %(hogql_val_139)s, %(hogql_val_140)s, %(hogql_val_141)s, %(hogql_val_142)s, %(hogql_val_143)s, %(hogql_val_144)s, %(hogql_val_145)s, %(hogql_val_146)s, %(hogql_val_147)s, %(hogql_val_148)s, %(hogql_val_149)s, %(hogql_val_150)s, %(hogql_val_151)s, %(hogql_val_152)s, %(hogql_val_153)s, %(hogql_val_154)s, %(hogql_val_155)s, %(hogql_val_156)s, %(hogql_val_157)s, %(hogql_val_158)s, %(hogql_val_159)s, %(hogql_val_160)s, %(hogql_val_161)s, %(hogql_val_162)s, %(hogql_val_163)s, %(hogql_val_164)s, %(hogql_val_165)s, %(hogql_val_166)s, %(hogql_val_167)s, %(hogql_val_168)s, %(hogql_val_169)s, %(hogql_val_170)s, %(hogql_val_171)s, %(hogql_val_172)s, %(hogql_val_173)s, %(hogql_val_174)s, %(hogql_val_175)s, %(hogql_val_176)s, %(hogql_val_177)s, %(hogql_val_178)s, %(hogql_val_179)s, %(hogql_val_180)s, %(hogql_val_181)s, %(hogql_val_182)s, %(hogql_val_183)s, %(hogql_val_184)s, %(hogql_val_185)s, %(hogql_val_186)s, %(hogql_val_187)s, %(hogql_val_188)s, %(hogql_val_189)s, %(hogql_val_190)s, %(hogql_val_191)s, %(hogql_val_192)s, %(hogql_val_193)s, %(hogql_val_194)s, %(hogql_val_195)s, %(hogql_val_196)s, %(hogql_val_197)s, %(hogql_val_198)s, %(hogql_val_199)s, %(hogql_val_200)s, %(hogql_val_201)s, %(hogql_val_202)s, %(hogql_val_203)s, %(hogql_val_204)s, %(hogql_val_205)s, %(hogql_val_206)s, %(hogql_val_207)s, %(hogql_val_208)s, %(hogql_val_209)s, %(hogql_val_210)s, %(hogql_val_211)s, %(hogql_val_212)s, %(hogql_val_213)s, %(hogql_val_214)s, %(hogql_val_215)s, %(hogql_val_216)s, %(hogql_val_217)s, %(hogql_val_218)s, %(hogql_val_219)s, %(hogql_val_220)s, %(hogql_val_221)s, %(hogql_val_222)s, %(hogql_val_223)s, %(hogql_val_224)s, %(hogql_val_225)s, %(hogql_val_226)s, %(hogql_val_227)s, %(hogql_val_228)s, %(hogql_val_229)s, %(hogql_val_230)s, %(hogql_val_231)s, %(hogql_val_232)s, %(hogql_val_233)s, %(hogql_val_234)s, %(hogql_val_235)s, %(hogql_val_236)s, %(hogql_val_237)s, %(hogql_val_238)s, %(hogql_val_239)s, %(hogql_val_240)s, %(hogql_val_241)s, %(hogql_val_242)s, %(hogql_val_243)s, %(hogql_val_244)s, %(hogql_val_245)s, %(hogql_val_246)s, %(hogql_val_247)s, %(hogql_val_248)s, %(hogql_val_249)s, %(hogql_val_250)s, %(hogql_val_251)s, %(hogql_val_252)s, %(hogql_val_253)s, %(hogql_val_254)s, %(hogql_val_255)s, %(hogql_val_256)s, %(hogql_val_257)s, %(hogql_val_258)s, %(hogql_val_259)s, %(hogql_val_260)s, %(hogql_val_261)s, %(hogql_val_262)s, %(hogql_val_263)s, %(hogql_val_264)s, %(hogql_val_265)s, %(hogql_val_266)s, %(hogql_val_267)s, %(hogql_val_268)s, %(hogql_val_269)s, %(hogql_val_270)s, %(hogql_val_271)s, %(hogql_val_272)s, %(hogql_val_273)s, %(hogql_val_274)s, %(hogql_val_275)s, %(hogql_val_276)s, %(hogql_val_277)s, %(hogql_val_278)s, %(hogql_val_279)s, %(hogql_val_280)s, %(hogql_val_281)s, %(hogql_val_282)s, %(hogql_val_283)s, %(hogql_val_284)s, %(hogql_val_285)s, %(hogql_val_286)s, %(hogql_val_287)s, %(hogql_val_288)s, %(hogql_val_289)s, %(hogql_val_290)s, %(hogql_val_291)s, %(hogql_val_292)s, %(hogql_val_293)s, %(hogql_val_294)s, %(hogql_val_295)s, %(hogql_val_296)s, %(hogql_val_297)s, %(hogql_val_298)s, %(hogql_val_299)s, %(hogql_val_300)s, %(hogql_val_301)s, %(hogql_val_302)s, %(hogql_val_303)s, %(hogql_val_304)s, %(hogql_val_305)s, %(hogql_val_306)s, %(hogql_val_307)s, %(hogql_val_308)s, %(hogql_val_309)s, %(hogql_val_310)s, %(hogql_val_311)s, %(hogql_val_312)s, %(hogql_val_313)s, %(hogql_val_314)s, %(hogql_val_315)s, %(hogql_val_316)s, %(hogql_val_317)s, %(hogql_val_318)s, %(hogql_val_319)s, %(hogql_val_320)s, %(hogql_val_321)s, %(hogql_val_322)s, %(hogql_val_323)s, %(hogql_val_324)s, %(hogql_val_325)s, %(hogql_val_326)s, %(hogql_val_327)s, %(hogql_val_328)s, %(hogql_val_329)s, %(hogql_val_330)s, %(hogql_val_331)s, %(hogql_val_332)s, %(hogql_val_333)s, %(hogql_val_334)s, %(hogql_val_335)s, %(hogql_val_336)s, %(hogql_val_337)s, %(hogql_val_338)s, %(hogql_val_339)s, %(hogql_val_340)s, %(hogql_val_341)s, %(hogql_val_342)s, %(hogql_val_343)s, %(hogql_val_344)s]), 0), 1), %(hogql_val_345)s) AS is_bot,
count() AS count
FROM
events_json AS events
@@ -170,7 +170,7 @@
ORDER BY
is_bot ASC
LIMIT 100
- SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1
+ SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0, json_type_escape_dots_in_keys=1, output_format_json_escape_forward_slashes=0
-- HogQL
SELECT
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
index 194db863451e..0684d9edac79 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_bots.new_events_schema.ambr
@@ -1,12 +1,12 @@
# serializer version: 1
# name: TestWebBotsTableQueryRunner.test_date_range_excludes_outside_events[new_events_schema]
'''
- SELECT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Crawler,
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), 'regular', ['search_crawler', 'search_crawler', 'search_crawler', 'ai_assistant', 'ai_search', 'ai_crawler', 'ai_assistant', 'ai_search', 'search_crawler', 'ai_search', 'seo_crawler'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Category,
+ SELECT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Crawler,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), 'regular', ['search_crawler', 'search_crawler', 'search_crawler', 'ai_assistant', 'ai_search', 'ai_crawler', 'ai_assistant', 'ai_search', 'search_crawler', 'ai_search', 'seo_crawler'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Category,
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-03-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -23,17 +23,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebBotsTableQueryRunner.test_only_bot_traffic_grouped_by_breakdown_0_Crawler[new_events_schema]
'''
- SELECT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Crawler,
- if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), 'regular', ['search_crawler', 'search_crawler', 'search_crawler', 'ai_assistant', 'ai_search', 'ai_crawler', 'ai_assistant', 'ai_search', 'search_crawler', 'ai_search', 'seo_crawler'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Category,
+ SELECT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Crawler,
+ if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), 'regular', ['search_crawler', 'search_crawler', 'search_crawler', 'ai_assistant', 'ai_search', 'ai_crawler', 'ai_assistant', 'ai_search', 'search_crawler', 'ai_search', 'seo_crawler'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]) AS Category,
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Crawler,
Category
ORDER BY Requests DESC
@@ -50,17 +51,18 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebBotsTableQueryRunner.test_only_bot_traffic_grouped_by_breakdown_1_Path[new_events_schema]
'''
- SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS Path,
- count(DISTINCT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])])) AS Crawlers,
+ SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS Path,
+ count(DISTINCT if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])])) AS Crawlers,
count() AS Requests,
max(toTimeZone(events.timestamp, 'UTC')) AS `Last seen`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$raw_user_agent`)), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(ifNull(equals(accurateCastOrNull(or(ifNull(notEquals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 1), or(/* bot ip ranges */)), 'Bool'), 1), 0), notEquals(if(ifNull(equals(multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */]), 0), 0), if(equals(multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0), 0), '', ['Googlebot', 'Google special crawler', 'Google fetcher', 'ChatGPT', 'OpenAI Search', 'GPTBot', 'Perplexity User', 'Perplexity', 'Bingbot', 'Applebot', 'Ahrefs'][multiIf(or(/* bot ip ranges */), 1, or(/* bot ip ranges */), 2, or(/* bot ip ranges */), 3, or(/* bot ip ranges */), 4, or(/* bot ip ranges */), 5, or(/* bot ip ranges */), 6, or(/* bot ip ranges */), 7, or(/* bot ip ranges */), 8, or(/* bot ip ranges */), 9, or(/* bot ip ranges */), 10, or(/* bot ip ranges */), 11, 0)]), [/* 344 bot literals */][multiMatchAnyIndex(ifNull(if(notEquals(toJSONString(events.properties.^`$raw_user_agent`), '{}'), toJSONString(events.properties.^`$raw_user_agent`), if(isNull(nullIf(toString(events.properties.`$raw_user_agent`), '')), NULL, if(and(in(ascii(toString(events.properties.`$raw_user_agent`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$raw_user_agent`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$raw_user_agent`), '[]'), '{}'), toString(events.properties.`$raw_user_agent`)))), ''), [/* 344 bot literals */])]), ''), in(events.event, tuple('$pageview', '$screen', '$http_log')), isNotNull(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2026-01-31 23:59:59', 'UTC')))), 0), 1))
GROUP BY Path
ORDER BY Requests DESC
LIMIT 51
@@ -76,6 +78,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
index 91e2080493ee..5cdebd4de608 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_goals.new_events_schema.ambr
@@ -21,28 +21,28 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS web_goals_person_id,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?data\\-node\\-key="interactions"(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
- GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_0,
+ countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?data\\-node\\-key="interactions"(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
+ GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
+ HAVING greater(sum(cohortpeople.sign), 0)))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_0,
countIf(0) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
countIf(0) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
- countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-input(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_2,
+ countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-input(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_2,
countIf(0) AS action_previous_count_2,
if(greater(action_current_count_2, 0), web_goals_person_id, NULL) AS action_current_person_id_2,
if(greater(action_previous_count_2, 0), web_goals_person_id, NULL) AS action_previous_person_id_2,
- countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn\\.(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?text\\-white(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://teest.com'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_3,
+ countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn\\.(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?text\\-white(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(CAST(events.properties.`$current_url`, 'Nullable(String)'), 'https://teest.com'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_3,
countIf(0) AS action_previous_count_3,
if(greater(action_current_count_3, 0), web_goals_person_id, NULL) AS action_current_person_id_3,
if(greater(action_previous_count_3, 0), web_goals_person_id, NULL) AS action_previous_person_id_3,
- countIf(and(and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))(?:(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*;)*(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://teest.com'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_4,
+ countIf(and(and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))(?:(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*;)*(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(CAST(events.properties.`$current_url`, 'Nullable(String)'), 'https://teest.com'), 0)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_4,
countIf(0) AS action_previous_count_4,
if(greater(action_current_count_4, 0), web_goals_person_id, NULL) AS action_current_person_id_4,
if(greater(action_previous_count_4, 0), web_goals_person_id, NULL) AS action_previous_person_id_4
@@ -60,12 +60,12 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?data\\-node\\-key="interactions"(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
- (SELECT cohortpeople.person_id AS person_id
- FROM cohortpeople
- WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
- GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
- HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-input(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn\\.(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?text\\-white(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))(?:(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*;)*(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://teest.com'), 0)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$host`)), if(isNull(nullIf(toString(events.properties.`mat_$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`mat_$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`mat_$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`mat_$host`), '[]'), '{}'), toString(events.properties.`mat_$host`)))), 'teest.com'), 0), ifNull(ilike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`mat_$current_url`)), if(isNull(nullIf(toString(events.properties.`mat_$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`mat_$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`mat_$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`mat_$current_url`), '[]'), '{}'), toString(events.properties.`mat_$current_url`))))), '%https://teest.com%'), 0)), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?data\\-node\\-key="interactions"(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0), in(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id),
+ (SELECT cohortpeople.person_id AS person_id
+ FROM cohortpeople
+ WHERE and(equals(cohortpeople.team_id, 99999), equals(cohortpeople.cohort_id, 99999))
+ GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
+ HAVING greater(sum(cohortpeople.sign), 0)))), and(equals(events.event, '$pageview'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-input(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), ifNull(like(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '%https://teest.com%'), 0)), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn\\.(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?text\\-white(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), arrayExists(x -> ifNull(equals(x, 'text page'), 0), events.elements_chain_texts), ifNull(equals(CAST(events.properties.`$current_url`, 'Nullable(String)'), 'https://teest.com'), 0)), and(equals(events.event, '$autocapture'), and(match(events.elements_chain, '(^|;)a(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))(?:(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*;)*(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?\\.ant\\-btn(?:[^;"]|"(?:\\\\.|[^"\\\\])*")*?($|;|:([^;^\\s]*(;|$|\\s)))'), greater(arrayCount(x -> in(x, ['a']), events.elements_chain_elements), 0)), arrayExists(x -> ifNull(equals(x, 'text'), 0), events.elements_chain_texts), ifNull(equals(CAST(events.properties.`$current_url`, 'Nullable(String)'), 'https://teest.com'), 0)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), and(ifNull(equals(CAST(events.properties.`mat_$host`, 'Nullable(String)'), 'teest.com'), 0), ifNull(ilike(toString(if(notEquals(toJSONString(events.properties.^`mat_$current_url`), '{}'), toJSONString(events.properties.^`mat_$current_url`), if(isNull(nullIf(toString(events.properties.`mat_$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`mat_$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`mat_$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`mat_$current_url`), '[]'), '{}'), toString(events.properties.`mat_$current_url`))))), '%https://teest.com%'), 0)), 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
LIMIT 100 SETTINGS readonly=2,
@@ -80,7 +80,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_dont_show_deleted_actions[new_events_schema]
@@ -100,9 +101,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1
@@ -120,7 +121,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -136,7 +137,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_many_users_and_actions[new_events_schema]
@@ -159,9 +161,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -183,7 +185,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -199,7 +201,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_no_comparison[new_events_schema]
@@ -222,7 +225,7 @@
countIf(0) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
countIf(0) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
@@ -245,7 +248,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0)
@@ -261,7 +264,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_no_crash_when_no_data_and_some_actions[new_events_schema]
@@ -284,9 +288,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -308,7 +312,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -324,7 +328,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_one_user_one_action[new_events_schema]
@@ -347,9 +352,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -371,7 +376,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -387,7 +392,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_one_user_two_different_actions[new_events_schema]
@@ -410,9 +416,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -434,7 +440,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -450,7 +456,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_one_user_two_similar_actions_across_sessions[new_events_schema]
@@ -473,9 +480,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -497,7 +504,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -513,7 +520,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebGoalsQueryRunner.test_one_users_one_action_each[new_events_schema]
@@ -536,9 +544,9 @@
countIf(and(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_0,
if(greater(action_current_count_0, 0), web_goals_person_id, NULL) AS action_current_person_id_0,
if(greater(action_previous_count_0, 0), web_goals_person_id, NULL) AS action_previous_person_id_0,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))))) AS action_current_count_1,
- countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))) AS action_previous_count_1,
if(greater(action_current_count_1, 0), web_goals_person_id, NULL) AS action_current_person_id_1,
if(greater(action_previous_count_1, 0), web_goals_person_id, NULL) AS action_previous_person_id_1,
@@ -560,7 +568,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), or(and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Contacted Sales'), 0), events.elements_chain_texts)), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://(app|eu|us)\\.posthog\\.com/project/\\d+/web.*'))), and(equals(events.event, '$autocapture'), match(events.elements_chain, '(^|;)button(\\.|$|;|:)'), arrayExists(x -> ifNull(equals(x, 'Pay $10'), 0), events.elements_chain_texts)))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC'))))), 1, 1))
GROUP BY events.properties.`$session_id`)
WHERE or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-11-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-08-03 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2024-10-31 23:59:59', 'UTC')))))
@@ -576,6 +584,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
index 9528355888be..4708a5d29a9d 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_overview.new_events_schema.ambr
@@ -50,7 +50,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_all_time[new_events_schema]
@@ -71,7 +72,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_comparison[new_events_schema]
@@ -125,7 +127,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_no_conversions[new_events_schema.1]
@@ -142,7 +145,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/bar'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -156,7 +159,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_no_conversions[new_events_schema]
@@ -210,7 +214,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_autocapture_conversion[new_events_schema.1]
@@ -240,7 +245,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_autocapture_conversion[new_events_schema]
@@ -294,7 +300,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_custom_action_conversion[new_events_schema.1]
@@ -324,7 +331,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_custom_action_conversion[new_events_schema]
@@ -378,7 +386,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_custom_event_conversion[new_events_schema.1]
@@ -408,7 +417,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_custom_event_conversion[new_events_schema]
@@ -462,7 +472,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_pageview_conversion[new_events_schema.1]
@@ -479,7 +490,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -493,7 +504,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_goal_one_pageview_conversion[new_events_schema]
@@ -547,7 +559,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_rate[new_events_schema.1]
@@ -564,7 +577,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -578,7 +591,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_conversion_rate[new_events_schema]
@@ -632,7 +646,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_convertToProjectTimezone_date_range_sql_snapshot[new_events_schema.1]
@@ -686,7 +701,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_convertToProjectTimezone_date_range_sql_snapshot[new_events_schema.2]
@@ -740,7 +756,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_convertToProjectTimezone_date_range_sql_snapshot[new_events_schema.3]
@@ -794,7 +811,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_convertToProjectTimezone_date_range_sql_snapshot[new_events_schema]
@@ -848,7 +866,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_correctly_counts_pageviews_in_long_running_session[new_events_schema]
@@ -902,7 +921,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_dont_filter_test_accounts[new_events_schema]
@@ -956,7 +976,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_filter_cohort[new_events_schema]
@@ -1015,7 +1036,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_filter_test_accounts[new_events_schema]
@@ -1054,7 +1076,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))), ifNull(notILike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
GROUP BY session_id
HAVING or(and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), and(greaterOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(start_timestamp, assumeNotNull(toDateTime('2023-11-30 23:59:59', 'UTC'))))))
LIMIT 100 SETTINGS readonly=2,
@@ -1069,7 +1091,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_first_pageview_attribution_rewrites_session_filters[new_events_schema.1]
@@ -1124,7 +1147,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_first_pageview_attribution_rewrites_session_filters[new_events_schema]
@@ -1166,7 +1190,7 @@
WHERE and(equals(events.team_id, 99999), and(isNotNull(events.properties.`$session_id`), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-30 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -1185,7 +1209,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_0_event[new_events_schema.1]
@@ -1202,7 +1227,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1215,7 +1240,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_0_event[new_events_schema.2]
@@ -1235,8 +1261,8 @@
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))) AS conversion_count,
- any(if(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
+ countIf(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))) AS conversion_count,
+ any(if(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
(SELECT multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'paid'), isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_gclid), 'null'), '')), isNotNull(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Organic Social', ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), '')), 'Referral', 'Unknown'))) AS `$channel_type`,
@@ -1254,7 +1280,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1277,7 +1303,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_0_event[new_events_schema.3]
@@ -1332,7 +1359,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_0_event[new_events_schema.4]
@@ -1350,8 +1378,8 @@
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))) AS conversion_count,
- any(if(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
+ countIf(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))) AS conversion_count,
+ any(if(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
(SELECT multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'paid'), isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_gclid), 'null'), '')), isNotNull(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Organic Social', ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), '')), 'Referral', 'Unknown'))) AS `$channel_type`,
@@ -1369,7 +1397,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1391,7 +1419,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_0_event[new_events_schema]
@@ -1445,7 +1474,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_1_action[new_events_schema.1]
@@ -1462,7 +1492,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -1475,7 +1505,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_1_action[new_events_schema.2]
@@ -1495,8 +1526,8 @@
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))) AS conversion_count,
- any(if(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
+ countIf(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))) AS conversion_count,
+ any(if(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
(SELECT multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'paid'), isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_gclid), 'null'), '')), isNotNull(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Organic Social', ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), '')), 'Referral', 'Unknown'))) AS `$channel_type`,
@@ -1514,7 +1545,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1537,7 +1568,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_1_action[new_events_schema.3]
@@ -1592,7 +1624,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_1_action[new_events_schema.4]
@@ -1610,8 +1643,8 @@
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))) AS conversion_count,
- any(if(and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
+ countIf(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))) AS conversion_count,
+ any(if(and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0)), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
(SELECT multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), 'cross-network'), 'Cross Network', or(in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), tuple('cpc', 'cpm', 'cpv', 'cpa', 'ppc', 'retargeting')), startsWith(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'paid'), isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_gclid), 'null'), '')), isNotNull(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'))), coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Paid Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_paid', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(ifNull(equals(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_gad_source), 'null'), ''), ''), 'null'), '1'), 0), 'Paid Search', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Paid Video', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Paid Social', 'Paid Unknown')), and(ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null'))), or(isNull(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null'))), in(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), tuple('(direct)', 'direct', '$direct'))), not(isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')))), 'Direct', coalesce(coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_source), 'null'), ''), ''), 'null')), '')), 'source'))), if(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*(([^a-df-z]|^)shop|shopping).*)$'), 'Organic Shopping', NULL), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), ''), 'medium')), coalesce(dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), ''), 'source')), dictGetOrNull('posthog_test.channel_definition_dict', 'type_if_organic', (cutToFirstSignificantSubdomain(coalesce(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '')), 'source'))), multiIf(match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_campaign), 'null'), ''), ''), 'null')), '^(.*video.*)$'), 'Organic Video', match(lower(nullIf(nullIf(nullIf(nullIf(argMinMerge(raw_sessions.initial_utm_medium), 'null'), ''), ''), 'null')), 'push$'), 'Push', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_fbclid), 'null'), '')), 'Organic Social', ifNull(equals(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), ''), '$direct'), 0), 'Direct', isNotNull(nullIf(nullIf(argMinMerge(raw_sessions.initial_referring_domain), 'null'), '')), 'Referral', 'Unknown'))) AS `$channel_type`,
@@ -1629,7 +1662,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'paid'), 0))), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, 'customer_created'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'paid'), 0))), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1651,7 +1684,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_goal_properties_preserve_visitors_and_deduplicate_customers_1_action[new_events_schema]
@@ -1705,7 +1739,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_increase_in_users[new_events_schema]
@@ -1759,7 +1794,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_increase_in_users_using_mobile[new_events_schema]
@@ -1813,7 +1849,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_limit_is_context_aware[new_events_schema]
@@ -1867,7 +1904,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_crash_when_no_data[new_events_schema.1]
@@ -1921,7 +1959,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_crash_when_no_data[new_events_schema.2]
@@ -1975,7 +2014,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_crash_when_no_data[new_events_schema.3]
@@ -1992,7 +2032,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-07 23:59:59', 'UTC'))))), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2006,7 +2046,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_crash_when_no_data[new_events_schema]
@@ -2060,7 +2101,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_previous_when_comparison_disabled_but_conversion_goal_enabled[new_events_schema.1]
@@ -2077,7 +2119,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), 1))
LIMIT 100 SETTINGS readonly=2,
max_execution_time=60,
@@ -2091,7 +2133,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewQueryRunner.test_no_previous_when_comparison_disabled_but_conversion_goal_enabled[new_events_schema]
@@ -2145,9 +2188,10 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebOverviewSessionIdSetFastPath.test_session_id_set_pushes_id_filter_below_session_aggregation[new_events_schema]
- "SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events_json AS events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_14)s), assumeNotNull(toDateTime(%(hogql_val_15)s, %(hogql_val_16)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_17)s), assumeNotNull(toDateTime(%(hogql_val_18)s, %(hogql_val_19)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), %(hogql_val_20)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_41)s, %(hogql_val_42)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_21)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_22)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_23)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_24)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_25)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_26)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_27)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_28)s, %(hogql_val_29)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_30)s, %(hogql_val_31)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT toUInt128(toUUIDOrNull(events.properties.`$session_id`)) AS session_id_uuid FROM events_json AS events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_32)s), equals(events.event, %(hogql_val_33)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_34)s), assumeNotNull(toDateTime(%(hogql_val_35)s, %(hogql_val_36)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_37)s), assumeNotNull(toDateTime(%(hogql_val_38)s, %(hogql_val_39)s)))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), %(hogql_val_40)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_53)s, %(hogql_val_54)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_55)s, %(hogql_val_56)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000"
+ "SELECT events_agg.unique_users AS unique_users, events_agg.previous_unique_users AS previous_unique_users, events_agg.total_filtered_pageview_count AS total_filtered_pageview_count, events_agg.previous_total_filtered_pageview_count AS previous_total_filtered_pageview_count, sessions_agg.unique_sessions AS unique_sessions, sessions_agg.previous_unique_sessions AS previous_unique_sessions, sessions_agg.avg_duration_s AS avg_duration_s, sessions_agg.previous_avg_duration_s AS previous_avg_duration_s, sessions_agg.bounce_rate AS bounce_rate, sessions_agg.previous_bounce_rate AS previous_bounce_rate FROM (SELECT uniqIf(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_0)s), assumeNotNull(toDateTime(%(hogql_val_1)s, %(hogql_val_2)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_3)s), assumeNotNull(toDateTime(%(hogql_val_4)s, %(hogql_val_5)s))))) AS unique_users, NULL AS previous_unique_users, countIf(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_6)s), assumeNotNull(toDateTime(%(hogql_val_7)s, %(hogql_val_8)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_9)s), assumeNotNull(toDateTime(%(hogql_val_10)s, %(hogql_val_11)s))))) AS total_filtered_pageview_count, NULL AS previous_total_filtered_pageview_count FROM events_json AS events LEFT OUTER JOIN (SELECT argMax(person_distinct_id_overrides.person_id, person_distinct_id_overrides.version) AS person_id, person_distinct_id_overrides.distinct_id AS distinct_id FROM person_distinct_id_overrides WHERE equals(person_distinct_id_overrides.team_id, <TEAM_ID>) GROUP BY person_distinct_id_overrides.distinct_id HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id) WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_12)s), equals(events.event, %(hogql_val_13)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_14)s), assumeNotNull(toDateTime(%(hogql_val_15)s, %(hogql_val_16)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_17)s), assumeNotNull(toDateTime(%(hogql_val_18)s, %(hogql_val_19)s)))), 0), ifNull(equals(CAST(events.properties.`$pathname`, 'Nullable(String)'), %(hogql_val_20)s), 0)))) AS events_agg CROSS JOIN (SELECT uniqIf(sessions.session_id, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_41)s, %(hogql_val_42)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_43)s, %(hogql_val_44)s))))) AS unique_sessions, NULL AS previous_unique_sessions, avgIf(sessions.`$session_duration`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_45)s, %(hogql_val_46)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_47)s, %(hogql_val_48)s))))) AS avg_duration_s, NULL AS previous_avg_duration_s, avgIf(sessions.`$is_bounce`, and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_49)s, %(hogql_val_50)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_51)s, %(hogql_val_52)s))))) AS bounce_rate, NULL AS previous_bounce_rate FROM (SELECT toString(reinterpretAsUUID(bitOr(bitShiftLeft(raw_sessions.session_id_v7, 64), bitShiftRight(raw_sessions.session_id_v7, 64)))) AS session_id, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_21)s)) AS `$start_timestamp`, dateDiff(%(hogql_val_22)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_23)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_24)s))) AS `$session_duration`, if(equals(uniqMerge(raw_sessions.pageview_uniq), 0), NULL, not(or(greater(uniqMerge(raw_sessions.pageview_uniq), 1), greater(uniqMerge(raw_sessions.autocapture_uniq), 0), greaterOrEquals(dateDiff(%(hogql_val_25)s, min(toTimeZone(raw_sessions.min_timestamp, %(hogql_val_26)s)), max(toTimeZone(raw_sessions.max_timestamp, %(hogql_val_27)s))), 10)))) AS `$is_bounce`, uniqMerge(raw_sessions.pageview_uniq) AS `$pageview_count`, uniqMerge(raw_sessions.screen_uniq) AS `$screen_count`, raw_sessions.session_id_v7 AS session_id_v7 FROM raw_sessions WHERE and(equals(raw_sessions.team_id, <TEAM_ID>), and(greaterOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), minus(assumeNotNull(toDateTime(%(hogql_val_28)s, %(hogql_val_29)s)), toIntervalDay(3))), lessOrEquals(fromUnixTimestamp(intDiv(toUInt64(bitShiftRight(raw_sessions.session_id_v7, 80)), 1000)), plus(assumeNotNull(toDateTime(%(hogql_val_30)s, %(hogql_val_31)s)), toIntervalDay(3)))), globalIn(raw_sessions.session_id_v7, (SELECT session_id_uuid AS session_id_uuid FROM (SELECT DISTINCT toUInt128(toUUIDOrNull(events.properties.`$session_id`)) AS session_id_uuid FROM events_json AS events WHERE and(equals(events.team_id, <TEAM_ID>), and(isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`))), or(equals(events.event, %(hogql_val_32)s), equals(events.event, %(hogql_val_33)s)), or(and(greaterOrEquals(toTimeZone(events.timestamp, %(hogql_val_34)s), assumeNotNull(toDateTime(%(hogql_val_35)s, %(hogql_val_36)s))), lessOrEquals(toTimeZone(events.timestamp, %(hogql_val_37)s), assumeNotNull(toDateTime(%(hogql_val_38)s, %(hogql_val_39)s)))), 0), ifNull(equals(CAST(events.properties.`$pathname`, 'Nullable(String)'), %(hogql_val_40)s), 0))))))) GROUP BY raw_sessions.session_id_v7) AS sessions WHERE and(or(and(greaterOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_53)s, %(hogql_val_54)s))), lessOrEquals(sessions.`$start_timestamp`, assumeNotNull(toDateTime(%(hogql_val_55)s, %(hogql_val_56)s)))), 0), or(greater(sessions.`$pageview_count`, 0), greater(sessions.`$screen_count`, 0)), 1)) AS sessions_agg LIMIT 50000"
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
index d2524a670bfc..42d38307cbcd 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_pre_aggregated.new_events_schema.ambr
@@ -8,7 +8,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser`)), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser`), '{}'), toJSONString(events.properties.^`$browser`), if(isNull(nullIf(toString(events.properties.`$browser`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser`), '[]'), '{}'), toString(events.properties.`$browser`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -39,7 +39,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsPreAggregated.test_breakdown_consistency_preagg_vs_regular[new_events_schema.2]
@@ -51,7 +52,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$geoip_country_code`)), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL, if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$geoip_country_code`), '{}'), toJSONString(events.properties.^`$geoip_country_code`), if(isNull(nullIf(toString(events.properties.`$geoip_country_code`), '')), NULL, if(and(in(ascii(toString(events.properties.`$geoip_country_code`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$geoip_country_code`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$geoip_country_code`), '[]'), '{}'), toString(events.properties.`$geoip_country_code`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -82,7 +83,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsPreAggregated.test_breakdown_consistency_preagg_vs_regular[new_events_schema.3]
@@ -135,7 +137,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsPreAggregated.test_breakdown_consistency_preagg_vs_regular[new_events_schema]
@@ -147,7 +150,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$device_type`)), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$device_type`), '{}'), toJSONString(events.properties.^`$device_type`), if(isNull(nullIf(toString(events.properties.`$device_type`), '')), NULL, if(and(in(ascii(toString(events.properties.`$device_type`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$device_type`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$device_type`), '[]'), '{}'), toString(events.properties.`$device_type`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -178,6 +181,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
index fe1ed80e44f2..1345b8df69ed 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_stats_table.new_events_schema.ambr
@@ -8,7 +8,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -40,7 +40,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_all_time[new_events_schema]
@@ -61,7 +62,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_can_compare[new_events_schema]
@@ -81,7 +83,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -104,13 +106,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-06 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-13 23:59:59', 'UTC')))), and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-11-28 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-05 23:59:59', 'UTC'))))), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -152,7 +154,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_multiple_routes_and_users[new_events_schema.1]
@@ -172,7 +175,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -195,13 +198,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -243,7 +246,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_multiple_routes_and_users[new_events_schema]
@@ -264,7 +268,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_page_multiple_users[new_events_schema.1]
@@ -284,7 +289,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -307,13 +312,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -355,7 +360,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_page_multiple_users[new_events_schema]
@@ -376,7 +382,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_page_one_user[new_events_schema.1]
@@ -396,7 +403,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -419,13 +426,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -467,7 +474,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_avg_time_on_page_one_user[new_events_schema]
@@ -488,7 +496,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate[new_events_schema.1]
@@ -507,7 +516,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -569,7 +578,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate[new_events_schema]
@@ -590,7 +600,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_one_user[new_events_schema.1]
@@ -609,7 +620,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -671,7 +682,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_one_user[new_events_schema]
@@ -692,7 +704,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_path_cleaning[new_events_schema.1]
@@ -711,7 +724,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/a\\/\\d+', '/a/:id'), '\\/b\\/\\d+', '/b/:id'), '\\/c\\/\\d+', '/c/:id') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/a\\/\\d+', '/a/:id'), '\\/b\\/\\d+', '/b/:id'), '\\/c\\/\\d+', '/c/:id') AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -773,7 +786,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_path_cleaning[new_events_schema]
@@ -794,7 +808,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_with_multiple_pathname_filters[new_events_schema.1]
@@ -813,7 +828,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -831,7 +846,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), tuple('/onboarding/portfolio-selection', '/')), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), in(CAST(events.properties.`$pathname`, 'Nullable(String)'), tuple('/onboarding/portfolio-selection', '/')), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -875,7 +890,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_with_multiple_pathname_filters[new_events_schema]
@@ -896,7 +912,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_with_property[new_events_schema.1]
@@ -915,7 +932,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -933,7 +950,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '/a'), 0), 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$screen')), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), ifNull(equals(CAST(events.properties.`$pathname`, 'Nullable(String)'), '/a'), 0), 1))
GROUP BY session_id,
breakdown_value)
GROUP BY breakdown_value) AS counts
@@ -977,7 +994,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_bounce_rate_with_property[new_events_schema]
@@ -998,7 +1016,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_breakdown_channel_type_doesnt_throw[new_events_schema]
@@ -1052,7 +1071,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_cohort_test_filters[new_events_schema.1]
@@ -1064,7 +1084,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -1099,7 +1119,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_cohort_test_filters[new_events_schema]
@@ -1120,7 +1141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_comparison[new_events_schema]
@@ -1132,7 +1154,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -1164,7 +1186,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_no_conversions[new_events_schema]
@@ -1178,13 +1201,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/bar')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/bar'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -1202,7 +1225,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/bar'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/bar')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -1225,7 +1248,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_one_autocapture_conversion[new_events_schema]
@@ -1283,7 +1307,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_one_custom_action_conversion[new_events_schema]
@@ -1341,7 +1366,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_one_custom_event_conversion[new_events_schema]
@@ -1399,7 +1425,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_one_pageview_conversion[new_events_schema.1]
@@ -1413,13 +1440,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -1437,7 +1464,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -1460,7 +1487,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_goal_one_pageview_conversion[new_events_schema]
@@ -1474,13 +1502,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -1498,7 +1526,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -1521,7 +1549,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_conversion_rate[new_events_schema]
@@ -1535,13 +1564,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -1559,7 +1588,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), 'https://www.example.com/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('https://www.example.com/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -1582,7 +1611,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_dont_filter_test_accounts[new_events_schema]
@@ -1594,7 +1624,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -1626,7 +1656,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate[new_events_schema.1]
@@ -1681,7 +1712,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate[new_events_schema]
@@ -1702,7 +1734,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_one_user[new_events_schema.1]
@@ -1757,7 +1790,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_one_user[new_events_schema]
@@ -1778,7 +1812,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_path_cleaning[new_events_schema.1]
@@ -1833,7 +1868,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_path_cleaning[new_events_schema]
@@ -1854,7 +1890,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_with_property[new_events_schema.1]
@@ -1888,7 +1925,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '/a'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(CAST(events.properties.`$pathname`, 'Nullable(String)'), '/a'), 0)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1909,7 +1946,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_entry_bounce_rate_with_property[new_events_schema]
@@ -1930,7 +1968,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_filter_test_accounts[new_events_schema]
@@ -1942,7 +1981,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -1953,7 +1992,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -1974,7 +2013,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_anchors_all_properties_to_one_event[new_events_schema.1]
@@ -1992,7 +2032,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2023,7 +2063,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_anchors_all_properties_to_one_event[new_events_schema.2]
@@ -2041,7 +2082,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2071,7 +2112,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_anchors_all_properties_to_one_event[new_events_schema]
@@ -2092,7 +2134,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_excludes_sessionless_events[new_events_schema.1]
@@ -2110,7 +2153,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2140,7 +2183,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_excludes_sessionless_events[new_events_schema]
@@ -2161,7 +2205,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_flag_flips_initial_breakdowns[new_events_schema.1]
@@ -2214,7 +2259,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_flag_flips_initial_breakdowns[new_events_schema.2]
@@ -2268,7 +2314,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_flag_flips_initial_breakdowns[new_events_schema.3]
@@ -2286,7 +2333,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2316,7 +2363,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_flag_flips_initial_breakdowns[new_events_schema.4]
@@ -2334,7 +2382,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2365,7 +2413,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_flag_flips_initial_breakdowns[new_events_schema]
@@ -2386,7 +2435,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_conversion_goal_events[new_events_schema.1]
@@ -2408,7 +2458,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp,
countIf(equals(events.event, 'custom_event')) AS conversion_count,
@@ -2441,7 +2491,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_conversion_goal_events[new_events_schema]
@@ -2462,7 +2513,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_non_pageview_first_event[new_events_schema.1]
@@ -2515,7 +2567,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_non_pageview_first_event[new_events_schema.2]
@@ -2569,7 +2622,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_non_pageview_first_event[new_events_schema.3]
@@ -2587,7 +2641,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2617,7 +2671,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_non_pageview_first_event[new_events_schema.4]
@@ -2635,7 +2690,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2666,7 +2721,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_ignores_non_pageview_first_event[new_events_schema]
@@ -2687,7 +2743,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_0_channel_type[new_events_schema.1]
@@ -2705,7 +2762,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2719,7 +2776,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -2743,7 +2800,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_0_channel_type[new_events_schema.2]
@@ -2797,7 +2855,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_0_channel_type[new_events_schema]
@@ -2818,7 +2877,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_1_utm_source[new_events_schema.1]
@@ -2836,7 +2896,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2850,7 +2910,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -2873,7 +2933,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_1_utm_source[new_events_schema.2]
@@ -2926,7 +2987,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_1_utm_source[new_events_schema]
@@ -2947,7 +3009,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_2_referring_domain[new_events_schema.1]
@@ -2965,7 +3028,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -2979,7 +3042,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -3002,7 +3065,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_2_referring_domain[new_events_schema.2]
@@ -3055,7 +3119,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_drill_down_filters_2_referring_domain[new_events_schema]
@@ -3076,7 +3141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_0_multi_value_exact[new_events_schema.1]
@@ -3094,7 +3160,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3108,7 +3174,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -3131,7 +3197,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_0_multi_value_exact[new_events_schema]
@@ -3152,7 +3219,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_1_multi_value_exact_matching_both[new_events_schema.1]
@@ -3170,7 +3238,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3184,7 +3252,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -3207,7 +3275,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_1_multi_value_exact_matching_both[new_events_schema]
@@ -3228,7 +3297,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_2_single_element_list[new_events_schema.1]
@@ -3246,7 +3316,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3260,7 +3330,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -3283,7 +3353,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_2_single_element_list[new_events_schema]
@@ -3304,7 +3375,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_3_empty_list[new_events_schema.1]
@@ -3322,7 +3394,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3352,7 +3424,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_3_empty_list[new_events_schema]
@@ -3373,7 +3446,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_4_multi_value_is_not[new_events_schema.1]
@@ -3391,7 +3465,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3405,7 +3479,7 @@
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), globalIn(events.properties.`$session_id`,
(SELECT session_id AS session_id
FROM
- (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
+ (SELECT events.properties.`$session_id` AS session_id, argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 10:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNotNull(toUInt128(toUUIDOrNull(events.properties.`$session_id`)))))
GROUP BY session_id)
@@ -3428,7 +3502,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_attribution_rewrites_list_valued_filters_4_multi_value_is_not[new_events_schema]
@@ -3449,7 +3524,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_0_referral_unknown_domain[new_events_schema.1]
@@ -3467,7 +3543,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3498,7 +3574,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_0_referral_unknown_domain[new_events_schema]
@@ -3519,7 +3596,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_1_gad_source_only[new_events_schema.1]
@@ -3537,7 +3615,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3568,7 +3646,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_1_gad_source_only[new_events_schema]
@@ -3589,7 +3668,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_2_bare_direct[new_events_schema.1]
@@ -3607,7 +3687,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- argMinIf(tuple(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_campaign)), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_medium)), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$referring_domain`)), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gclid)), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^fbclid)), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^gad_source)), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
+ argMinIf(tuple(if(notEquals(toJSONString(events.properties.^utm_campaign), '{}'), toJSONString(events.properties.^utm_campaign), if(isNull(nullIf(toString(events.properties.utm_campaign), '')), NULL, if(and(in(ascii(toString(events.properties.utm_campaign)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_campaign)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_campaign), '[]'), '{}'), toString(events.properties.utm_campaign)))), if(notEquals(toJSONString(events.properties.^utm_medium), '{}'), toJSONString(events.properties.^utm_medium), if(isNull(nullIf(toString(events.properties.utm_medium), '')), NULL, if(and(in(ascii(toString(events.properties.utm_medium)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_medium)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_medium), '[]'), '{}'), toString(events.properties.utm_medium)))), if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))), if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), if(notEquals(toJSONString(events.properties.^`$referring_domain`), '{}'), toJSONString(events.properties.^`$referring_domain`), if(isNull(nullIf(toString(events.properties.`$referring_domain`), '')), NULL, if(and(in(ascii(toString(events.properties.`$referring_domain`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$referring_domain`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$referring_domain`), '[]'), '{}'), toString(events.properties.`$referring_domain`)))), if(notEquals(toJSONString(events.properties.^gclid), '{}'), toJSONString(events.properties.^gclid), if(isNull(nullIf(toString(events.properties.gclid), '')), NULL, if(and(in(ascii(toString(events.properties.gclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gclid), '[]'), '{}'), toString(events.properties.gclid)))), if(notEquals(toJSONString(events.properties.^fbclid), '{}'), toJSONString(events.properties.^fbclid), if(isNull(nullIf(toString(events.properties.fbclid), '')), NULL, if(and(in(ascii(toString(events.properties.fbclid)), tuple(91, 123)), in(ascii(toJSONString(events.properties.fbclid)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.fbclid), '[]'), '{}'), toString(events.properties.fbclid)))), if(notEquals(toJSONString(events.properties.^gad_source), '{}'), toJSONString(events.properties.^gad_source), if(isNull(nullIf(toString(events.properties.gad_source), '')), NULL, if(and(in(ascii(toString(events.properties.gad_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.gad_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.gad_source), '[]'), '{}'), toString(events.properties.gad_source))))), toTimeZone(events.timestamp, 'UTC'), in(events.event, tuple('$pageview', '$screen'))) AS first_pageview_properties,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3638,7 +3718,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_first_pageview_channel_type_buckets_2_bare_direct[new_events_schema]
@@ -3659,7 +3740,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_in_app_browser_breakdown_groups_by_webview_app_and_drops_regular_traffic[new_events_schema]
@@ -3671,7 +3753,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$webview_app`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$webview_app`)), if(isNull(nullIf(toString(events.properties.`$webview_app`), '')), NULL, if(and(in(ascii(toString(events.properties.`$webview_app`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$webview_app`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$webview_app`), '[]'), '{}'), toString(events.properties.`$webview_app`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$webview_app`), '{}'), toJSONString(events.properties.^`$webview_app`), if(isNull(nullIf(toString(events.properties.`$webview_app`), '')), NULL, if(and(in(ascii(toString(events.properties.`$webview_app`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$webview_app`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$webview_app`), '[]'), '{}'), toString(events.properties.`$webview_app`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3703,7 +3785,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_0_Page[new_events_schema.1]
@@ -3715,7 +3798,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- nullIf(concat(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), ''), ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '')), '') AS breakdown_value,
+ nullIf(concat(ifNull(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), ''), ifNull(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '')), '') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -3747,7 +3830,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_0_Page[new_events_schema]
@@ -3768,7 +3852,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_1_InitialPage[new_events_schema.1]
@@ -3823,7 +3908,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_1_InitialPage[new_events_schema]
@@ -3844,7 +3930,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_2_ExitPage[new_events_schema.1]
@@ -3899,7 +3986,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_concatenates_host_and_path_2_ExitPage[new_events_schema]
@@ -3920,7 +4008,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_exit_page_breakdown_counts_correctly[new_events_schema.1]
@@ -3975,7 +4064,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_exit_page_breakdown_counts_correctly[new_events_schema]
@@ -3996,7 +4086,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_0_Page[new_events_schema.1]
@@ -4008,7 +4099,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4040,7 +4131,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_0_Page[new_events_schema]
@@ -4061,7 +4153,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_1_InitialPage[new_events_schema.1]
@@ -4115,7 +4208,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_1_InitialPage[new_events_schema]
@@ -4136,7 +4230,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_2_ExitPage[new_events_schema.1]
@@ -4190,7 +4285,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_false_returns_path_only_2_ExitPage[new_events_schema]
@@ -4211,7 +4307,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_initial_page_breakdown_with_bounce_rate[new_events_schema.1]
@@ -4267,7 +4364,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_initial_page_breakdown_with_bounce_rate[new_events_schema]
@@ -4288,7 +4386,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_page_breakdown_groups_same_paths_on_different_hosts_separately[new_events_schema.1]
@@ -4300,7 +4399,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- nullIf(concat(ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), ''), ifNull(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '')), '') AS breakdown_value,
+ nullIf(concat(ifNull(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), ''), ifNull(toString(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`))))), '')), '') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4332,7 +4431,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_page_breakdown_groups_same_paths_on_different_hosts_separately[new_events_schema.2]
@@ -4344,7 +4444,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4376,7 +4476,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_include_host_page_breakdown_groups_same_paths_on_different_hosts_separately[new_events_schema]
@@ -4397,7 +4498,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_increase_in_users[new_events_schema]
@@ -4409,7 +4511,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4441,7 +4543,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_increase_in_users_on_mobile[new_events_schema]
@@ -4453,7 +4556,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$screen_name`)), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$screen_name`), '{}'), toJSONString(events.properties.^`$screen_name`), if(isNull(nullIf(toString(events.properties.`$screen_name`), '')), NULL, if(and(in(ascii(toString(events.properties.`$screen_name`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$screen_name`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$screen_name`), '[]'), '{}'), toString(events.properties.`$screen_name`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4485,7 +4588,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_is_not_set_filter[new_events_schema.1]
@@ -4518,7 +4622,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^utm_source)), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-26 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-06-27 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), isNull(if(notEquals(toJSONString(events.properties.^utm_source), '{}'), toJSONString(events.properties.^utm_source), if(isNull(nullIf(toString(events.properties.utm_source), '')), NULL, if(and(in(ascii(toString(events.properties.utm_source)), tuple(91, 123)), in(ascii(toJSONString(events.properties.utm_source)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.utm_source), '[]'), '{}'), toString(events.properties.utm_source)))))))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4538,7 +4642,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_is_not_set_filter[new_events_schema]
@@ -4559,7 +4664,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_language_filter[new_events_schema.1]
@@ -4572,7 +4678,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser_language`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$browser_language`)), if(isNull(nullIf(toString(events.properties.`$browser_language`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser_language`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser_language`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser_language`), '[]'), '{}'), toString(events.properties.`$browser_language`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$browser_language`), '{}'), toJSONString(events.properties.^`$browser_language`), if(isNull(nullIf(toString(events.properties.`$browser_language`), '')), NULL, if(and(in(ascii(toString(events.properties.`$browser_language`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$browser_language`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$browser_language`), '[]'), '{}'), toString(events.properties.`$browser_language`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4583,7 +4689,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.person_properties.^email)), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2024-07-30 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-29 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(notILike(toString(if(notEquals(toJSONString(events.person_properties.^email), '{}'), toJSONString(events.person_properties.^email), if(isNull(nullIf(toString(events.person_properties.email), '')), NULL, if(and(in(ascii(toString(events.person_properties.email)), tuple(91, 123)), in(ascii(toJSONString(events.person_properties.email)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.person_properties.email), '[]'), '{}'), toString(events.person_properties.email))))), '%@posthog.com%'), 1)))
GROUP BY session_id,
breakdown_value)
GROUP BY `context.columns.breakdown_value`
@@ -4603,7 +4709,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_language_filter[new_events_schema]
@@ -4624,7 +4731,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_limit[new_events_schema.1]
@@ -4636,7 +4744,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4668,7 +4776,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_limit[new_events_schema.2]
@@ -4680,7 +4789,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4712,7 +4821,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_limit[new_events_schema]
@@ -4733,7 +4843,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_no_crash_when_no_data[new_events_schema]
@@ -4745,7 +4856,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4777,7 +4888,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_no_session_id[new_events_schema.1]
@@ -4831,7 +4943,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_no_session_id[new_events_schema.2]
@@ -4885,7 +4998,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_no_session_id[new_events_schema.3]
@@ -4897,7 +5011,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -4929,7 +5043,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_no_session_id[new_events_schema]
@@ -4950,7 +5065,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_null_in_utm_tags[new_events_schema.1]
@@ -5003,7 +5119,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_null_in_utm_tags[new_events_schema]
@@ -5024,7 +5141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_null_prev_pageview_duration_excluded_from_p90[new_events_schema.1]
@@ -5044,7 +5162,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -5067,13 +5185,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -5115,7 +5233,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_null_prev_pageview_duration_excluded_from_p90[new_events_schema]
@@ -5136,7 +5255,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters[new_events_schema.1]
@@ -5148,7 +5268,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5180,7 +5300,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters[new_events_schema]
@@ -5201,7 +5322,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_applied_in_order[new_events_schema.1]
@@ -5213,7 +5335,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/admin\\/settings\\/.*', '/admin/settings/<page>'), '\\/admin\\/.*', '/admin/<section>'), '\\/user\\/\\d+\\/.*', '/user/<id>/<page>') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/admin\\/settings\\/.*', '/admin/settings/<page>'), '\\/admin\\/.*', '/admin/<section>'), '\\/user\\/\\d+\\/.*', '/user/<id>/<page>') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5245,7 +5367,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_applied_in_order[new_events_schema]
@@ -5266,7 +5389,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_capture_group_backreference[new_events_schema.1]
@@ -5278,7 +5402,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/item\\/(\\d+)\\/detail\\/\\d+', '/item/\\1') AS breakdown_value,
+ replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/item\\/(\\d+)\\/detail\\/\\d+', '/item/\\1') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5310,7 +5434,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_capture_group_backreference[new_events_schema]
@@ -5331,7 +5456,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_cleanable_path_property[new_events_schema.1]
@@ -5343,7 +5469,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id') AS breakdown_value,
+ replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5354,7 +5480,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')), isNull(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'))
and isNull(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id')))))
GROUP BY session_id,
breakdown_value)
@@ -5376,7 +5502,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_cleanable_path_property[new_events_schema]
@@ -5397,7 +5524,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_cleaned_path_property[new_events_schema.1]
@@ -5409,7 +5537,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5420,7 +5548,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/:id', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
@@ -5442,7 +5570,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_cleaned_path_property[new_events_schema.2]
@@ -5454,7 +5583,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5465,7 +5594,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen')), ifNull(equals(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'), replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')), isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c'))
and isNull(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll('/cleaned/123456', '\\/cleaned\\/\\d+', '/cleaned/:id'), '\\/path\\/\\d+', '/path/:id'), 'thing_a', 'thing_b'), 'thing_b', 'thing_c')))))
GROUP BY session_id,
breakdown_value)
@@ -5487,7 +5616,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_cleaned_path_property[new_events_schema]
@@ -5508,7 +5638,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_multiple_capture_groups[new_events_schema.1]
@@ -5520,7 +5651,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/item\\/(\\d+)\\/detail\\/(\\d+)', '/item/<id>/detail/<detail_id>') AS breakdown_value,
+ replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/item\\/(\\d+)\\/detail\\/(\\d+)', '/item/<id>/detail/<detail_id>') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5552,7 +5683,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_filters_with_multiple_capture_groups[new_events_schema]
@@ -5573,7 +5705,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_with_order_field_and_baseline_urls[new_events_schema.1]
@@ -5585,7 +5718,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '/item/(\\d+)/list/(\\d+)/spp/insessionForm/(\\d+)', '/item/<id>/list/<list_id>/spp/insessionForm/<form>'), '/item/(\\d+)/detail1/(\\d+)', '/item/<id>/detail1/<consultation>'), '/item/(\\d+)/list/(\\d+)', '/item/<id>/list/<list_id>'), '/item/(\\d+)', '/item/<id>') AS breakdown_value,
+ replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '/item/(\\d+)/list/(\\d+)/spp/insessionForm/(\\d+)', '/item/<id>/list/<list_id>/spp/insessionForm/<form>'), '/item/(\\d+)/detail1/(\\d+)', '/item/<id>/detail1/<consultation>'), '/item/(\\d+)/list/(\\d+)', '/item/<id>/list/<list_id>'), '/item/(\\d+)', '/item/<id>') AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5617,7 +5750,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_path_cleaning_with_order_field_and_baseline_urls[new_events_schema]
@@ -5638,7 +5772,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_same_user_multiple_sessions[new_events_schema.1]
@@ -5691,7 +5826,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_same_user_multiple_sessions[new_events_schema.2]
@@ -5703,7 +5839,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -5735,7 +5871,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_same_user_multiple_sessions[new_events_schema.3]
@@ -5754,7 +5891,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -5816,7 +5953,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_same_user_multiple_sessions[new_events_schema]
@@ -5837,7 +5975,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_bounce_rate[new_events_schema.1]
@@ -5856,7 +5995,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -5919,7 +6058,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_bounce_rate[new_events_schema.2]
@@ -5938,7 +6078,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -6001,7 +6141,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_bounce_rate[new_events_schema]
@@ -6022,7 +6163,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_conversion_rate[new_events_schema.1]
@@ -6036,13 +6178,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -6060,7 +6202,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -6084,7 +6226,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_conversion_rate[new_events_schema]
@@ -6098,13 +6241,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -6122,7 +6265,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -6146,7 +6289,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_total_conversions[new_events_schema.1]
@@ -6160,13 +6304,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -6184,7 +6328,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -6207,7 +6351,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_total_conversions[new_events_schema]
@@ -6221,13 +6366,13 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
any(events__session.`$is_bounce`) AS is_bounce,
min(events__session.`$start_timestamp`) AS start_timestamp,
- countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ countIf(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))) AS conversion_count,
- any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ any(if(and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo'))), if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id), NULL)) AS conversion_person_id
FROM events_json AS events
LEFT JOIN
@@ -6245,7 +6390,7 @@
WHERE equals(person_distinct_id_overrides.team_id, 99999)
GROUP BY person_distinct_id_overrides.distinct_id
HAVING equals(argMax(person_distinct_id_overrides.is_deleted, person_distinct_id_overrides.version), 0) SETTINGS optimize_aggregation_in_order=1) AS events__override ON equals(events.distinct_id, events__override.distinct_id)
- WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$current_url`)), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
+ WHERE and(equals(events.team_id, 99999), and(or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-01 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-03 23:59:59', 'UTC')))), 0), or(equals(events.event, '$pageview'), equals(events.event, '$screen'), and(equals(events.event, '$pageview'), ifNull(match(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))), '/foo'), isNull(if(notEquals(toJSONString(events.properties.^`$current_url`), '{}'), toJSONString(events.properties.^`$current_url`), if(isNull(nullIf(toString(events.properties.`$current_url`), '')), NULL, if(and(in(ascii(toString(events.properties.`$current_url`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$current_url`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$current_url`), '[]'), '{}'), toString(events.properties.`$current_url`)))))
and isNull('/foo')))), 1))
GROUP BY session_id,
breakdown_value)
@@ -6268,7 +6413,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_views[new_events_schema.1]
@@ -6280,7 +6426,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -6312,7 +6458,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_views[new_events_schema.2]
@@ -6324,7 +6471,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -6356,7 +6503,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_views[new_events_schema]
@@ -6377,7 +6525,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_visitors[new_events_schema.1]
@@ -6389,7 +6538,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -6421,7 +6570,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_visitors[new_events_schema.2]
@@ -6433,7 +6583,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), events.properties.`$session_id`, NULL) AS session_id,
any(if(ifNull(equals(bitAnd(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 76), 15), 7), 0), fromUnixTimestamp(intDiv(accurateCastOrNull(bitShiftRight(toUInt128(toUUIDOrNull(events.properties.`$session_id`)), 80), 'Int64'), 1000)), NULL)) AS start_timestamp
FROM events_json AS events
@@ -6465,7 +6615,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_sorting_by_visitors[new_events_schema]
@@ -6486,7 +6637,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_source_medium_campaign[new_events_schema.1]
@@ -6543,7 +6695,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_source_medium_campaign[new_events_schema]
@@ -6564,7 +6717,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_time_on_page_caps_at_24_hours[new_events_schema.1]
@@ -6584,7 +6738,7 @@
FROM
(SELECT any(if(not(empty(events__override.distinct_id)), events__override.person_id, events.person_id)) AS filtered_person_id,
count() AS filtered_pageview_count,
- if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
+ if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS breakdown_value,
events__session.session_id AS session_id,
min(events__session.`$start_timestamp`) AS start_timestamp
FROM events_json AS events
@@ -6607,13 +6761,13 @@
breakdown_value)
GROUP BY breakdown_value) AS counts
LEFT JOIN
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`)))) AS breakdown_value,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC'))))) AS avg_time_on_page,
quantileIf(0.9)(least(accurateCastOrNull(events.properties.`$prev_pageview_duration`, 'Float64'), 86400),
0) AS previous_avg_time_on_page
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_pathname`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$prev_pageview_duration`)), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
+ WHERE and(equals(events.team_id, 99999), and(or(equals(events.event, '$pageview'), equals(events.event, '$pageleave'), equals(events.event, '$screen')), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_pathname`), '{}'), toJSONString(events.properties.^`$prev_pageview_pathname`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_pathname`), '[]'), '{}'), toString(events.properties.`$prev_pageview_pathname`))))), isNotNull(if(notEquals(toJSONString(events.properties.^`$prev_pageview_duration`), '{}'), toJSONString(events.properties.^`$prev_pageview_duration`), if(isNull(nullIf(toString(events.properties.`$prev_pageview_duration`), '')), NULL, if(and(in(ascii(toString(events.properties.`$prev_pageview_duration`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$prev_pageview_duration`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$prev_pageview_duration`), '[]'), '{}'), toString(events.properties.`$prev_pageview_duration`))))), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-02 12:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2023-12-15 23:59:59', 'UTC')))), 0), 1, 1))
GROUP BY breakdown_value) AS time_on_page ON equals(counts.breakdown_value, time_on_page.breakdown_value)
LEFT JOIN
(SELECT breakdown_value AS breakdown_value,
@@ -6655,7 +6809,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_time_on_page_caps_at_24_hours[new_events_schema]
@@ -6676,7 +6831,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_timezone_filter_general[new_events_schema]
@@ -6719,7 +6875,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_timezone_filter_with_invalid_timezone_offset[new_events_schema.1]
@@ -6762,7 +6919,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_timezone_filter_with_invalid_timezone_offset[new_events_schema.2]
@@ -6805,7 +6963,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_timezone_filter_with_invalid_timezone_offset[new_events_schema.3]
@@ -6848,7 +7007,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebStatsTableQueryRunner.test_timezone_filter_with_invalid_timezone_offset[new_events_schema]
@@ -6869,6 +7029,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
index b5117aa070d8..e96245ccf818 100644
--- a/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
+++ b/products/web_analytics/backend/hogql_queries/test/__snapshots__/test_web_vitals_path_breakdown.new_events_schema.ambr
@@ -9,7 +9,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -30,7 +30,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_limit_of_20_paths[new_events_schema]
@@ -43,7 +44,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -64,7 +65,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_no_crash_when_no_data[new_events_schema]
@@ -77,7 +79,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -98,7 +100,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_no_data_for_different_metric[new_events_schema]
@@ -111,7 +114,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_LCP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -132,7 +135,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_no_data_for_different_period[new_events_schema]
@@ -145,7 +149,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -166,7 +170,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_path_cleaning_filters[new_events_schema]
@@ -179,7 +184,7 @@
path AS path,
value AS value
FROM
- (SELECT replaceRegexpAll(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/<id>') AS path,
+ (SELECT replaceRegexpAll(if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '\\/cleaned\\/\\d+', '/cleaned/<id>') AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -200,7 +205,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_percentile_is_applied[new_events_schema.1]
@@ -213,7 +219,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.9)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -234,7 +240,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_percentile_is_applied[new_events_schema.2]
@@ -247,7 +254,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.99)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -268,7 +275,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_percentile_is_applied[new_events_schema]
@@ -281,7 +289,7 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), 1))
@@ -302,7 +310,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestWebVitalsPathBreakdownQueryRunner.test_properties_are_applied[new_events_schema]
@@ -315,10 +324,10 @@
path AS path,
value AS value
FROM
- (SELECT if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
+ (SELECT if(notEquals(toJSONString(events.properties.^`$pathname`), '{}'), toJSONString(events.properties.^`$pathname`), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))) AS path,
quantile(0.75)(accurateCastOrNull(events.properties.`$web_vitals_INP_value`, 'Float64')) AS value
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$pathname`)), if(isNull(nullIf(toString(events.properties.`$pathname`), '')), NULL, if(and(in(ascii(toString(events.properties.`$pathname`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$pathname`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$pathname`), '[]'), '{}'), toString(events.properties.`$pathname`)))), '/path1'), 0)))
+ WHERE and(equals(events.team_id, 99999), and(equals(events.event, '$web_vitals'), isNotNull(path), or(and(greaterOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-08 00:00:00', 'UTC'))), lessOrEquals(toTimeZone(events.timestamp, 'UTC'), assumeNotNull(toDateTime('2025-01-15 23:59:59', 'UTC')))), 0), ifNull(equals(CAST(events.properties.`$pathname`, 'Nullable(String)'), '/path1'), 0)))
GROUP BY path
HAVING ifNull(greaterOrEquals(value, 0), 0)))
ORDER BY value ASC,
@@ -336,6 +345,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
diff --git a/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.new_events_schema.ambr b/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.new_events_schema.ambr
index 13f3b41bc642..e3de8fafa73b 100644
--- a/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.new_events_schema.ambr
+++ b/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.new_events_schema.ambr
@@ -9,7 +9,7 @@
WHERE and(equals(heatmaps.team_id, 99999), equals(heatmaps.type, 'click'), greaterOrEquals(heatmaps.timestamp, toDateTime64(toDate('2023-03-08'), 6, 'UTC')), lessOrEquals(heatmaps.timestamp, toDateTime64(plus('2025-03-31', toIntervalDay(1)), 6, 'UTC')), not(and(equals(heatmaps.x, 0), equals(heatmaps.y, 0))), globalIn(heatmaps.session_id,
(SELECT DISTINCT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('today', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-08 00:00:00.000000', 6, 'UTC')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '%127.0.0.1%'), 1))))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('today', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-08 00:00:00.000000', 6, 'UTC')), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '%127.0.0.1%'), 1))))))
LIMIT 1000000 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -22,7 +22,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_can_filter_by_test_accounts[new_events_schema]
@@ -41,7 +42,7 @@
WHERE and(equals(heatmaps.team_id, 99999), equals(heatmaps.type, 'click'), greaterOrEquals(heatmaps.timestamp, toDateTime64(toDate('2023-03-08'), 6, 'UTC')), lessOrEquals(heatmaps.timestamp, toDateTime64(plus('2025-03-31', toIntervalDay(1)), 6, 'UTC')), not(and(equals(heatmaps.x, 0), equals(heatmaps.y, 0))), globalIn(heatmaps.session_id,
(SELECT DISTINCT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('today', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-08 00:00:00.000000', 6, 'UTC')), ifNull(notILike(toString(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^`$host`)), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '%127.0.0.1%'), 1)))))))
+ WHERE and(equals(events.team_id, 99999), notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('today', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-08 00:00:00.000000', 6, 'UTC')), ifNull(notILike(toString(if(notEquals(toJSONString(events.properties.^`$host`), '{}'), toJSONString(events.properties.^`$host`), if(isNull(nullIf(toString(events.properties.`$host`), '')), NULL, if(and(in(ascii(toString(events.properties.`$host`)), tuple(91, 123)), in(ascii(toJSONString(events.properties.`$host`)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.`$host`), '[]'), '{}'), toString(events.properties.`$host`))))), '%127.0.0.1%'), 1)))))))
GROUP BY pointer_target_fixed,
pointer_relative_x,
client_y
@@ -59,7 +60,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_also_narrows_the_interaction_drill_down[new_events_schema.1]
@@ -91,7 +93,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_also_narrows_the_interaction_drill_down[new_events_schema]
@@ -115,7 +118,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_applies_the_property_filters_carried_by_an_event[new_events_schema.1]
@@ -128,7 +132,7 @@
WHERE and(equals(heatmaps.team_id, 99999), equals(heatmaps.type, 'click'), greaterOrEquals(heatmaps.timestamp, toDateTime64(toDate('2023-03-08'), 6, 'UTC')), lessOrEquals(heatmaps.timestamp, toDateTime64(plus('2025-03-31', toIntervalDay(1)), 6, 'UTC')), not(and(equals(heatmaps.x, 0), equals(heatmaps.y, 0))), globalIn(heatmaps.session_id,
(SELECT DISTINCT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('2025-04-02 00:00:00.000000', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-07 00:00:00.000000', 6, 'UTC')))), and(equals(events.event, 'purchase'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'pro'), 0))))))
+ WHERE and(equals(events.team_id, 99999), and(notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('2025-04-02 00:00:00.000000', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-07 00:00:00.000000', 6, 'UTC')))), and(equals(events.event, 'purchase'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'pro'), 0))))))
LIMIT 1000000 SETTINGS readonly=2,
max_execution_time=60,
allow_experimental_object_type=1,
@@ -141,7 +145,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_applies_the_property_filters_carried_by_an_event[new_events_schema]
@@ -160,7 +165,7 @@
WHERE and(equals(heatmaps.team_id, 99999), equals(heatmaps.type, 'click'), greaterOrEquals(heatmaps.timestamp, toDateTime64(toDate('2023-03-08'), 6, 'UTC')), lessOrEquals(heatmaps.timestamp, toDateTime64(plus('2025-03-31', toIntervalDay(1)), 6, 'UTC')), not(and(equals(heatmaps.x, 0), equals(heatmaps.y, 0))), globalIn(heatmaps.session_id,
(SELECT DISTINCT events.properties.`$session_id` AS `$session_id`
FROM events_json AS events
- WHERE and(equals(events.team_id, 99999), and(notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('2025-04-02 00:00:00.000000', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-07 00:00:00.000000', 6, 'UTC')))), and(equals(events.event, 'purchase'), ifNull(equals(if(notEquals(JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), '{}'), JSONStripEmptyStringsAndNulls(toJSONString(events.properties.^plan)), if(isNull(nullIf(toString(events.properties.plan), '')), NULL, if(and(in(ascii(toString(events.properties.plan)), tuple(91, 123)), in(ascii(toJSONString(events.properties.plan)), tuple(91, 123))), nullIf(nullIf(toJSONString(events.properties.plan), '[]'), '{}'), toString(events.properties.plan)))), 'pro'), 0)))))))
+ WHERE and(equals(events.team_id, 99999), and(notEmpty(events.properties.`$session_id`), and(less(events.timestamp, toDateTime64('2025-04-02 00:00:00.000000', 6, 'UTC')), greaterOrEquals(events.timestamp, toDateTime64('2023-03-07 00:00:00.000000', 6, 'UTC')))), and(equals(events.event, 'purchase'), ifNull(equals(CAST(events.properties.plan, 'Nullable(String)'), 'pro'), 0)))))))
GROUP BY pointer_target_fixed,
pointer_relative_x,
client_y
@@ -178,7 +183,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_keeps_a_session_whose_event_landed_before_the_window[new_events_schema.1]
@@ -204,7 +210,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_keeps_a_session_whose_event_landed_before_the_window[new_events_schema]
@@ -241,7 +248,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_narrows_to_sessions_containing_every_selected_event[new_events_schema.1]
@@ -267,7 +275,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_narrows_to_sessions_containing_every_selected_event[new_events_schema.2]
@@ -307,7 +316,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_narrows_to_sessions_containing_every_selected_event[new_events_schema.3]
@@ -336,7 +346,8 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---
# name: TestSessionRecordings.test_event_filter_narrows_to_sessions_containing_every_selected_event[new_events_schema]
@@ -373,6 +384,7 @@
optimize_min_inequality_conjunction_chain_length=4294967295,
allow_experimental_join_condition=1,
use_hive_partitioning=0,
- json_type_escape_dots_in_keys=1
+ json_type_escape_dots_in_keys=1,
+ output_format_json_escape_forward_slashes=0
'''
# ---