Skip to content

Commit

Permalink
fix(insights): Increase max AST size for funnel time to convert (#20628)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Feb 29, 2024
1 parent 30bdd3e commit 926b403
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
9 changes: 6 additions & 3 deletions posthog/api/test/__snapshots__/test_insight_funnels.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: ClickhouseTestFunnelTypes.test_funnel_time_to_convert_auto_bins_strict
Expand Down Expand Up @@ -229,7 +230,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: ClickhouseTestFunnelTypes.test_funnel_time_to_convert_auto_bins_unordered
Expand Down Expand Up @@ -438,6 +440,7 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
1 change: 1 addition & 0 deletions posthog/queries/funnels/funnel_time_to_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def get_query(self) -> str:
) fill
USING (bin_from_seconds)
ORDER BY bin_from_seconds
SETTINGS max_ast_elements=1000000, max_expanded_ast_elements=1000000
"""

return query
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: TestFunnelTimeToConvert.test_auto_bin_count_total
Expand Down Expand Up @@ -248,7 +249,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: TestFunnelTimeToConvert.test_auto_bin_count_total.1
Expand Down Expand Up @@ -374,7 +376,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: TestFunnelTimeToConvert.test_basic_strict
Expand Down Expand Up @@ -481,7 +484,8 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---
# name: TestFunnelTimeToConvert.test_basic_unordered
Expand Down Expand Up @@ -690,6 +694,7 @@
(SELECT histogram_from_seconds + number * bin_width_seconds AS bin_from_seconds
FROM system.numbers
LIMIT ifNull(bin_count, 0) + 1) fill USING (bin_from_seconds)
ORDER BY bin_from_seconds
ORDER BY bin_from_seconds SETTINGS max_ast_elements=1000000,
max_expanded_ast_elements=1000000
'''
# ---

0 comments on commit 926b403

Please sign in to comment.