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): move default execution time to 120sec #21212

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions posthog/api/test/__snapshots__/test_query.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -29,7 +29,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -46,7 +46,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -63,7 +63,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -80,7 +80,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -97,7 +97,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -110,7 +110,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -123,7 +123,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -136,7 +136,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -151,7 +151,7 @@
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand Down Expand Up @@ -191,7 +191,7 @@
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -206,7 +206,7 @@
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -225,7 +225,7 @@
ORDER BY toTimeZone(events.timestamp, 'UTC') ASC) AS event_view
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -242,7 +242,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -259,7 +259,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -276,7 +276,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -293,7 +293,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -310,7 +310,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -327,7 +327,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -344,7 +344,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -361,7 +361,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand Down Expand Up @@ -396,7 +396,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand Down Expand Up @@ -431,7 +431,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -446,7 +446,7 @@
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -462,7 +462,7 @@
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -477,7 +477,7 @@
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -493,7 +493,7 @@
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -508,7 +508,7 @@
ORDER BY events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -524,7 +524,7 @@
ORDER BY replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.properties, 'key'), ''), 'null'), '^"|"$', '') ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -538,7 +538,7 @@
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=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -553,7 +553,7 @@
ORDER BY count() DESC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
Expand All @@ -568,7 +568,7 @@
ORDER BY count() DESC, events.event ASC
LIMIT 101
OFFSET 0 SETTINGS readonly=2,
max_execution_time=60,
max_execution_time=120,
allow_experimental_object_type=1
'''
# ---
2 changes: 1 addition & 1 deletion posthog/hogql/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ class HogQLQuerySettings(BaseModel):
class HogQLGlobalSettings(HogQLQuerySettings):
model_config = ConfigDict(extra="forbid")
readonly: Optional[int] = 2
max_execution_time: Optional[int] = 60
max_execution_time: Optional[int] = 120
allow_experimental_object_type: Optional[bool] = True
2 changes: 1 addition & 1 deletion posthog/hogql/database/test/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_database_with_warehouse_tables(self, patch_execute):

self.assertEqual(
response.clickhouse,
f"SELECT whatever.id AS id FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_3_sensitive)s, %(hogql_val_4_sensitive)s, %(hogql_val_1)s, %(hogql_val_2)s) AS whatever LIMIT 100 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1",
f"SELECT whatever.id AS id FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_3_sensitive)s, %(hogql_val_4_sensitive)s, %(hogql_val_1)s, %(hogql_val_2)s) AS whatever LIMIT 100 SETTINGS readonly=2, max_execution_time=120, allow_experimental_object_type=1",
)

def test_database_group_type_mappings(self):
Expand Down
6 changes: 3 additions & 3 deletions posthog/hogql/functions/test/__snapshots__/test_cohort.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
GROUP BY cohortpeople.person_id, cohortpeople.cohort_id, cohortpeople.version
HAVING ifNull(greater(sum(cohortpeople.sign), 0), 0))), equals(events.event, %(hogql_val_0)s))
LIMIT 100
SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1
SETTINGS readonly=2, max_execution_time=120, allow_experimental_object_type=1

-- HogQL

Expand All @@ -38,7 +38,7 @@
FROM person_static_cohort
WHERE and(equals(person_static_cohort.team_id, 420), equals(person_static_cohort.cohort_id, XX)))))
LIMIT 100
SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1
SETTINGS readonly=2, max_execution_time=120, allow_experimental_object_type=1

-- HogQL

Expand All @@ -62,7 +62,7 @@
FROM person_static_cohort
WHERE and(equals(person_static_cohort.team_id, 420), equals(person_static_cohort.cohort_id, XX)))))
LIMIT 100
SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1
SETTINGS readonly=2, max_execution_time=120, allow_experimental_object_type=1

-- HogQL

Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql/functions/test/test_sparkline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_sparkline(self):
response = execute_hogql_query("select sparkline([1,2,3])", self.team, pretty=False)
self.assertEqual(
response.clickhouse,
f"SELECT tuple(%(hogql_val_0)s, %(hogql_val_1)s, %(hogql_val_2)s, [1, 2, 3]) LIMIT 100 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1",
f"SELECT tuple(%(hogql_val_0)s, %(hogql_val_1)s, %(hogql_val_2)s, [1, 2, 3]) LIMIT 100 SETTINGS readonly=2, max_execution_time=120, allow_experimental_object_type=1",
)
self.assertEqual(
response.hogql,
Expand Down
Loading
Loading