Comparisons: Fix exports issue (#4756)

* Increase max_parser_depth setting

This is currently causing issues in production with exports w/ comparisons, but
would blow up in other cases with sufficient data.

The reason this is now blowing up is that we create a large AND/OR condition
for breakdown comparisons. ecto-ch nests each conditional in its separate parentheses
causing us to reach the default 1000 max_parser_depth limit

We can improve this in a couple of ways:
- Not add unneccessary parentheses in ecto-ch
- Adding a new operator to make the AND/OR nesting require less conditionals, using
arrays and tuples instead

* Don't query comparisons for exports

csv exports don't actually output any comparison data, so querying for
it just causes issues.
This commit is contained in:
Karl-Aksel Puulmann 2024-10-30 15:40:26 +02:00 committed by GitHub
parent dd79ad3c22
commit 62fb285b71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ export default function StatsExport() {
function renderExportLink() {
const interval = getCurrentInterval(site, query)
const queryParams = api.serializeQuery(query, [{ interval }])
const queryParams = api.serializeQuery(query, [{ interval, comparison: undefined }])
const endpoint = `/${encodeURIComponent(site.domain)}/export${queryParams}`
return (

View File

@ -547,7 +547,8 @@ config :plausible, Plausible.ClickhouseRepo,
transport_opts: ch_transport_opts,
settings: [
readonly: 1,
join_algorithm: "direct,parallel_hash,hash"
join_algorithm: "direct,parallel_hash,hash",
max_parser_depth: 100_000
]
config :plausible, Plausible.IngestRepo,