diff --git a/posthog/api/test/__snapshots__/test_insight.ambr b/posthog/api/test/__snapshots__/test_insight.ambr index 70f4452c7f1fc7..ed7b781fe02c22 100644 --- a/posthog/api/test/__snapshots__/test_insight.ambr +++ b/posthog/api/test/__snapshots__/test_insight.ambr @@ -23,7 +23,7 @@ AND event IN ['user did things', 'user signed up'] AND toTimeZone(timestamp, 'UTC') >= toDateTime('2012-01-08 00:00:00', 'UTC') AND toTimeZone(timestamp, 'UTC') <= toDateTime('2012-01-15 23:59:59', 'UTC') - AND (and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1)) + AND (and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1)) GROUP BY value ORDER BY count DESC, value DESC LIMIT 26 @@ -107,7 +107,7 @@ AND event IN ['user did things', 'user signed up'] AND toTimeZone(timestamp, 'UTC') >= toDateTime('2012-01-08 00:00:00', 'UTC') AND toTimeZone(timestamp, 'UTC') <= toDateTime('2012-01-15 23:59:59', 'UTC') - AND (and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1)) + AND (and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1)) AND (step_0 = 1 OR step_1 = 1) ))) WHERE step_0 = 1 )) @@ -182,7 +182,7 @@ AND event IN ['user did things', 'user signed up'] AND toTimeZone(timestamp, 'UTC') >= toDateTime('2012-01-08 00:00:00', 'UTC') AND toTimeZone(timestamp, 'UTC') <= toDateTime('2012-01-15 23:59:59', 'UTC') - AND ((and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1)) + AND ((and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1)) AND (ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person_properties, 'fish'), ''), 'null'), '^"|"$', ''), '%fish%'), 0))) AND (step_0 = 1 OR step_1 = 1) )) @@ -227,11 +227,11 @@ pdi.person_id as person_id, person.person_props as person_props, if(event = 'user signed up' - AND (and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1) + AND (and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1) AND ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person_properties, 'fish'), ''), 'null'), '^"|"$', ''), '%fish%'), 0)), 1, 0) as step_0, if(step_0 = 1, timestamp, null) as latest_0, if(event = 'user did things' - AND (and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1) + AND (and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1) AND ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person_properties, 'fish'), ''), 'null'), '^"|"$', ''), '%fish%'), 0)), 1, 0) as step_1, if(step_1 = 1, timestamp, null) as latest_1 FROM events e @@ -271,7 +271,7 @@ # name: TestInsight.test_insight_trend_hogql_breakdown ''' /* user_id:0 request:_snapshot_ */ - SELECT if(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 'le%ss', 'more') AS value, + SELECT if(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 'le%ss', 'more') AS value, count(*) as count FROM events e WHERE team_id = 2 @@ -313,7 +313,7 @@ day_start UNION ALL SELECT count(*) as total, toStartOfDay(toTimeZone(toDateTime(timestamp, 'UTC'), 'UTC')) as day_start, - transform(ifNull(nullIf(if(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 'le%ss', 'more'), ''), '$$_posthog_breakdown_null_$$'), (['more', 'le%ss']), (['more', 'le%ss']), '$$_posthog_breakdown_other_$$') as breakdown_value + transform(ifNull(nullIf(if(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 'le%ss', 'more'), ''), '$$_posthog_breakdown_null_$$'), (['more', 'le%ss']), (['more', 'le%ss']), '$$_posthog_breakdown_other_$$') as breakdown_value FROM events e WHERE e.team_id = 2 AND event = '$pageview' @@ -458,7 +458,7 @@ AND event = '$pageview' AND toTimeZone(timestamp, 'UTC') >= toDateTime(toStartOfDay(toDateTime('2012-01-08 00:00:00', 'UTC')), 'UTC') AND toTimeZone(timestamp, 'UTC') <= toDateTime('2012-01-15 23:59:59', 'UTC') - AND ((and(ifNull(greater(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1)) + AND ((and(ifNull(greater(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1)) AND (ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person_properties, 'fish'), ''), 'null'), '^"|"$', ''), '%fish%'), 0))) GROUP BY date) GROUP BY day_start @@ -582,7 +582,7 @@ AND event = '$pageview' AND toTimeZone(timestamp, 'UTC') >= toDateTime(toStartOfDay(toDateTime('2012-01-08 00:00:00', 'UTC')), 'UTC') AND toTimeZone(timestamp, 'UTC') <= toDateTime('2012-01-15 23:59:59', 'UTC') - AND (and(ifNull(less(accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, 'int_value'), ''), 'null'), '^"|"$', ''), 'Int64'), 10), 0), 1) + AND (and(ifNull(less(accurateCastOrNull(has(events.properties_group_custom, 'int_value') ? events.properties_group_custom['int_value'] : null, 'Int64'), 10), 0), 1) AND ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(person_properties, 'fish'), ''), 'null'), '^"|"$', ''), '%fish%'), 0)) GROUP BY date) GROUP BY day_start diff --git a/posthog/api/test/__snapshots__/test_query.ambr b/posthog/api/test/__snapshots__/test_query.ambr index fbea79986c2bad..4ad33b9f4a8a06 100644 --- a/posthog/api/test/__snapshots__/test_query.ambr +++ b/posthog/api/test/__snapshots__/test_query.ambr @@ -4,9 +4,9 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events WHERE and(equals(events.team_id, 2), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC @@ -25,11 +25,11 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events - WHERE and(equals(events.team_id, 2), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', ''), 'test_val3'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) + WHERE and(equals(events.team_id, 2), ifNull(equals(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null, 'test_val3'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC LIMIT 101 OFFSET 0 SETTINGS readonly=2, @@ -46,11 +46,11 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events - WHERE and(equals(events.team_id, 2), ifNull(ilike(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'path'), ''), 'null'), '^"|"$', ''), '%/%'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) + WHERE and(equals(events.team_id, 2), ifNull(ilike(has(events.properties_group_custom, 'path') ? events.properties_group_custom['path'] : null, '%/%'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC LIMIT 101 OFFSET 0 SETTINGS readonly=2, @@ -181,7 +181,7 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key FROM events WHERE equals(events.team_id, 2) ORDER BY toTimeZone(events.timestamp, 'UTC') ASC @@ -219,7 +219,7 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key FROM events WHERE equals(events.team_id, 2) ORDER BY toTimeZone(events.timestamp, 'UTC') ASC @@ -242,7 +242,7 @@ FROM (SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key FROM events WHERE equals(events.team_id, 2) ORDER BY toTimeZone(events.timestamp, 'UTC') ASC) AS event_view @@ -261,9 +261,9 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events WHERE and(equals(events.team_id, 2), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC @@ -282,9 +282,9 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events WHERE and(equals(events.team_id, 2), 0, less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC @@ -303,9 +303,9 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events WHERE and(equals(events.team_id, 2), 1, less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC @@ -324,11 +324,11 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events - WHERE and(equals(events.team_id, 2), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', ''), 'test_val2'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) + WHERE and(equals(events.team_id, 2), ifNull(equals(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null, 'test_val2'), 0), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) ORDER BY events.event ASC LIMIT 101 OFFSET 0 SETTINGS readonly=2, @@ -429,9 +429,9 @@ /* user_id:0 request:_snapshot_ */ SELECT events.event AS event, events.distinct_id AS distinct_id, - replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - 'a%sd', - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + 'a%sd', + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events INNER JOIN (SELECT argMax(person_distinct_id2.person_id, person_distinct_id2.version) AS events__pdi___person_id, @@ -505,11 +505,11 @@ # name: TestQuery.test_property_filter_aggregations ''' /* user_id:0 request:_snapshot_ */ - SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - count() + SELECT has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + count() FROM events WHERE and(equals(events.team_id, 2), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) - GROUP BY replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') + GROUP BY has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null ORDER BY count() DESC LIMIT 101 OFFSET 0 SETTINGS readonly=2, @@ -524,11 +524,11 @@ # name: TestQuery.test_property_filter_aggregations.1 ''' /* user_id:0 request:_snapshot_ */ - SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - count() + SELECT has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + count() FROM events WHERE and(equals(events.team_id, 2), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) - GROUP BY replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') + GROUP BY has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null HAVING ifNull(greater(count(), 1), 0) ORDER BY count() DESC LIMIT 101 @@ -602,13 +602,13 @@ # name: TestQuery.test_select_hogql_expressions ''' /* user_id:0 request:_snapshot_ */ - SELECT replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') AS key, - events.event AS event, - events.distinct_id AS distinct_id, - concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '')), '')) + SELECT has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null AS key, + events.event AS event, + events.distinct_id AS distinct_id, + concat(ifNull(toString(events.event), ''), ' ', ifNull(toString(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null), '')) FROM events WHERE and(equals(events.team_id, 2), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) - ORDER BY replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') ASC + ORDER BY has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null ASC LIMIT 101 OFFSET 0 SETTINGS readonly=2, max_execution_time=60, @@ -662,7 +662,7 @@ SELECT count(), events.event AS event FROM events - WHERE and(equals(events.team_id, 2), or(equals(events.event, 'sign up'), ifNull(like(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', ''), '%val2'), 0)), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) + WHERE and(equals(events.team_id, 2), or(equals(events.event, 'sign up'), ifNull(like(has(events.properties_group_custom, 'key') ? events.properties_group_custom['key'] : null, '%val2'), 0)), less(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-10 12:14:05.000000', 6, 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime64('2020-01-09 12:14:00.000000', 6, 'UTC'))) GROUP BY events.event ORDER BY count() DESC, events.event ASC LIMIT 101