From 180860567d0308180ff313a5a3ed39d2c0b2cee2 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Mon, 29 Jun 2026 18:23:49 +0100 Subject: [PATCH] fix(clickhouse): raise binary type complexity limit so nested JSON columns stay readable Runs whose output or error payloads produce a deeply nested materialized type can exceed ClickHouse's default binary type complexity of 1000 when the JSON-typed column is read back. The read fails for the whole query, so those runs vanish from the runs list even though they are still counted by status aggregates. Set input_format_binary_max_type_complexity on the client so every query reads these columns without erroring. --- .server-changes/clickhouse-binary-type-complexity.md | 6 ++++++ internal-packages/clickhouse/src/client/client.ts | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 .server-changes/clickhouse-binary-type-complexity.md diff --git a/.server-changes/clickhouse-binary-type-complexity.md b/.server-changes/clickhouse-binary-type-complexity.md new file mode 100644 index 00000000000..ffd1b25ed91 --- /dev/null +++ b/.server-changes/clickhouse-binary-type-complexity.md @@ -0,0 +1,6 @@ +--- +area: webapp +type: fix +--- + +Fix runs with deeply nested output or error payloads disappearing from the runs list by raising the ClickHouse binary type complexity limit diff --git a/internal-packages/clickhouse/src/client/client.ts b/internal-packages/clickhouse/src/client/client.ts index 29323d14182..19e997fc4be 100644 --- a/internal-packages/clickhouse/src/client/client.ts +++ b/internal-packages/clickhouse/src/client/client.ts @@ -72,6 +72,10 @@ export class ClickhouseClient implements ClickhouseReader, ClickhouseWriter { output_format_json_quote_64bit_integers: 0, output_format_json_quote_64bit_floats: 0, cancel_http_readonly_queries_on_client_close: 1, + // Deeply nested JSON-typed columns (e.g. run output/error) can exceed + // the default binary type complexity of 1000 when read back, which + // fails the whole query. Raise the ceiling so those rows stay readable. + input_format_binary_max_type_complexity: 100000, }, log: { level: convertLogLevelToClickhouseLogLevel(config.logLevel),