Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hogql): type class refactor, field to constant type resolving #15129

Merged
merged 26 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f66b735
feat(hogql): rename refs to types
mariusandra Apr 17, 2023
87f142c
add constant types, fix macro types
mariusandra Apr 17, 2023
2d28640
bool types
mariusandra Apr 17, 2023
a463581
datetimes and uuids
mariusandra Apr 17, 2023
3b935d7
array
mariusandra Apr 17, 2023
0a390da
generate types for some nodes
mariusandra Apr 17, 2023
f1e75ae
rename fields in ast.SelectQueryAliasType
mariusandra Apr 17, 2023
83f35c2
rename ast fields
mariusandra Apr 17, 2023
5282051
not "type"
mariusandra Apr 17, 2023
8e7cbe9
rename name to "alias"
mariusandra Apr 17, 2023
341a257
rename types to ops
mariusandra Apr 17, 2023
997504a
Update query snapshots
github-actions[bot] Apr 17, 2023
2a5cdc5
Update query snapshots
github-actions[bot] Apr 17, 2023
3c1f616
feat(hogql): type class refactor
mariusandra Apr 18, 2023
7845c2a
annotate
mariusandra Apr 18, 2023
2841a55
array
mariusandra Apr 18, 2023
2c09532
feat(hogql): type class refactor
mariusandra Apr 18, 2023
9232749
annotate
mariusandra Apr 18, 2023
0136a50
array
mariusandra Apr 18, 2023
ecfc6ab
Update query snapshots
github-actions[bot] Apr 18, 2023
55cbecc
Update query snapshots
github-actions[bot] Apr 18, 2023
a8eb5d2
Update query snapshots
github-actions[bot] Apr 18, 2023
e4d5176
Merge branch 'hogql-types-improved' of github.com:PostHog/posthog int…
mariusandra Apr 18, 2023
11dd2a7
Merge branch 'master' into hogql-types-improved
mariusandra Apr 18, 2023
966870c
Merge branch 'master' into hogql-types-improved
mariusandra Apr 18, 2023
326a9e2
Update query snapshots
github-actions[bot] Apr 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions posthog/api/test/__snapshots__/test_query.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 68), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 68), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -23,7 +23,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 68), equals(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), 'test_val3'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 68), equals(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), 'test_val3'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -39,7 +39,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 68), ilike(replaceRegexpAll(JSONExtractRaw(events.properties, 'path'), '^"|"$', ''), '%/%'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 68), ilike(replaceRegexpAll(JSONExtractRaw(events.properties, 'path'), '^"|"$', ''), '%/%'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -55,7 +55,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 69), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 69), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -71,7 +71,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 69), equals(events.mat_key, 'test_val3'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 69), equals(events.mat_key, 'test_val3'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -87,7 +87,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 69), ilike(events.mat_path, '%/%'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 69), ilike(events.mat_path, '%/%'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -102,7 +102,7 @@
replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', '')
FROM events
WHERE equals(events.team_id, 70)
ORDER BY toTimezone(events.timestamp, 'UTC') ASC
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
LIMIT 100 SETTINGS readonly=1,
max_execution_time=60
'
Expand All @@ -115,7 +115,7 @@
events.mat_key
FROM events
WHERE equals(events.team_id, 71)
ORDER BY toTimezone(events.timestamp, 'UTC') ASC
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
LIMIT 100 SETTINGS readonly=1,
max_execution_time=60
'
Expand All @@ -129,7 +129,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 72), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 72), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -145,7 +145,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 72), equals('a%sd', 'foo'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 72), equals('a%sd', 'foo'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -161,7 +161,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 72), equals('a%sd', 'a%sd'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 72), equals('a%sd', 'a%sd'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -177,7 +177,7 @@
'a%sd',
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 72), equals(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), 'test_val2'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 72), equals(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), 'test_val2'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -193,7 +193,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 73), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 73), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -209,7 +209,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 73), equals('a%sd', 'foo'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 73), equals('a%sd', 'foo'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -225,7 +225,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 73), equals('a%sd', 'a%sd'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 73), equals('a%sd', 'a%sd'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -241,7 +241,7 @@
'a%sd',
concat(events.event, ' ', events.mat_key)
FROM events
WHERE and(equals(events.team_id, 73), equals(events.mat_key, 'test_val2'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 73), equals(events.mat_key, 'test_val2'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand Down Expand Up @@ -271,7 +271,7 @@
WHERE equals(person.team_id, 77)
GROUP BY person.id
HAVING equals(argMax(person.is_deleted, person.version), 0)) AS events__pdi__person ON equals(events__pdi.person_id, events__pdi__person.id)
WHERE and(equals(events.team_id, 77), equals(events__pdi__person.properties___email, '[email protected]'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 77), equals(events__pdi__person.properties___email, '[email protected]'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand Down Expand Up @@ -301,7 +301,7 @@
WHERE equals(person.team_id, 78)
GROUP BY person.id
HAVING equals(argMax(person.is_deleted, person.version), 0)) AS events__pdi__person ON equals(events__pdi.person_id, events__pdi__person.id)
WHERE and(equals(events.team_id, 78), equals(events__pdi__person.properties___email, '[email protected]'), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 78), equals(events__pdi__person.properties___email, '[email protected]'), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -314,7 +314,7 @@
SELECT replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''),
count()
FROM events
WHERE and(equals(events.team_id, 79), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 79), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', '')
ORDER BY count() DESC
LIMIT 101
Expand All @@ -328,7 +328,7 @@
SELECT replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''),
count()
FROM events
WHERE and(equals(events.team_id, 79), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 79), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', '')
HAVING and(greater(count(), 1))
ORDER BY count() DESC
Expand All @@ -343,7 +343,7 @@
SELECT events.mat_key,
count()
FROM events
WHERE and(equals(events.team_id, 80), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 80), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY events.mat_key
ORDER BY count() DESC
LIMIT 101
Expand All @@ -357,7 +357,7 @@
SELECT events.mat_key,
count()
FROM events
WHERE and(equals(events.team_id, 80), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 80), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY events.mat_key
HAVING and(greater(count(), 1))
ORDER BY count() DESC
Expand All @@ -373,7 +373,7 @@
events.distinct_id,
events.distinct_id
FROM events
WHERE and(equals(events.team_id, 81), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 81), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -388,7 +388,7 @@
events.distinct_id,
concat(events.event, ' ', replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''))
FROM events
WHERE and(equals(events.team_id, 82), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 82), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', '') ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
Expand All @@ -398,11 +398,11 @@
# name: TestQuery.test_select_hogql_expressions.1
'
/* user_id:0 request:_snapshot_ */
SELECT tuple(events.uuid, events.event, events.properties, toTimezone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimezone(events.created_at, 'UTC')),
SELECT tuple(events.uuid, events.event, events.properties, toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC')),
events.event
FROM events
WHERE and(equals(events.team_id, 82), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY tuple(events.uuid, events.event, events.properties, toTimezone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimezone(events.created_at, 'UTC')) ASC
WHERE and(equals(events.team_id, 82), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
ORDER BY tuple(events.uuid, events.event, events.properties, toTimeZone(events.timestamp, 'UTC'), events.team_id, events.distinct_id, events.elements_chain, toTimeZone(events.created_at, 'UTC')) ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=1,
max_execution_time=60
Expand All @@ -414,7 +414,7 @@
SELECT count(),
events.event
FROM events
WHERE and(equals(events.team_id, 82), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 82), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY events.event
ORDER BY count() DESC
LIMIT 101
Expand All @@ -428,7 +428,7 @@
SELECT count(),
events.event
FROM events
WHERE and(equals(events.team_id, 82), or(equals(events.event, 'sign up'), like(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), '%val2')), less(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimezone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
WHERE and(equals(events.team_id, 82), or(equals(events.event, 'sign up'), like(replaceRegexpAll(JSONExtractRaw(events.properties, 'key'), '^"|"$', ''), '%val2')), less(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-10 12:14:05', 'UTC')), greater(toTimeZone(events.timestamp, 'UTC'), toDateTime('2020-01-09 12:00:00', 'UTC')))
GROUP BY events.event
ORDER BY count() DESC, events.event ASC
LIMIT 101
Expand Down
Loading