Skip to content

TSKV: infer the schema from the bytes the value path parses - #113158

Open
groeneai wants to merge 3 commits into
ClickHouse:masterfrom
groeneai:tskv-schema-inference-raw-bytes
Open

groeneai wants to merge 3 commits into
ClickHouse:masterfrom
groeneai:tskv-schema-inference-raw-bytes

Conversation

@groeneai

@groeneai groeneai commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixes TSKV schema inference proposing a type the TSKV value path cannot read, so DESCRIBE succeeded while SELECT on the same input failed with CANNOT_PARSE_INPUT_ASSERTION_FAILED, CANNOT_READ_ARRAY_FROM_TEXT or CANNOT_READ_MAP_FROM_TEXT. Inference now reads the raw field bytes, the same bytes the value path parses.

Description

TSKVSchemaReader::readRowAndGetNamesAndDataTypes read each field with readEscapedString, which decodes escape sequences, while TSKVRowInputFormat::readRow parses the original bytes. Inference therefore answered a question about bytes that are never parsed: c=[0\x2E5] inferred Array(Nullable(Float64)) from the decoded [0.5] and then failed to read, because the array reader stops at the backslash.

The schema reader now uses readTSVField, which does not decode; TSKV was the only escaped-rule reader that decoded before inferring. #112226's numeric guard tested only the top-level inferred type, so an escape inside a Date or inside a container still inferred an unreadable type; it is now dead and removed.

This has one compatibility consequence. A field equal to the null representation stops decoding to the empty string, so it would infer Nullable(Nothing), join the cross-row merge, and let this format's String default discard a container type another row inferred. A field therefore contributes no type, as the decoded empty string used to, only where the value path reads it as a null rather than as data: \N, while \N is the null representation. That keeps 02240_tskv_schema_inference_bug's reference; every other field, including the text NULL and \N under a different representation, carries bytes the reader must parse and merges like any other value.

Inference thus changes for escaped fields, and for x=\N once the null representation is something else. x=\N under a different representation and x=\N\N improve on master, which names a container for them and then cannot read the null row.

Validation: 04653 covers seven carriers and fails on unmodified master; its null cells are measured against master on ten inputs across both input_format_null_as_default arms; a 239-test sweep of the schema_inference, tskv, tsv, csv, custom_separated, regexp and template families is green apart from six needing absent infrastructure (S3/MinIO, the stateful dataset, a URL fixture, a second server); 30 randomized runs green.


Workflow [PR]
Sync PR [sync-upstream/pr/113158]

@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (11 rounds, adjudicated)

An independent model reviewed this branch cold at each round, and the findings below were adjudicated
against the code and the recorded evidence. Verdicts are mine.

❌ Fixed as a result of review

Eleven fix rounds; the substantive ones, in order:

# Finding Fix
1 A negative integer merged with a UInt64-range value widened to UInt64 and then failed to read its own bytes Sign provenance is recorded and consulted before that widening
2 Provenance was lost whenever two equal types were collapsed (row merge, array, map key, map value) carryOverProvenanceOnEqualTypes, plus carry loops at all six collapse sites
3 Provenance keyed on a type object address, while the object could be freed and its address reused, so an unrelated column silently inferred String or UInt64 depending on row order Recorded identities keep their owner alive; the set is private behind markNegativeInteger
4 The widening predicate reported a hazard for shapes transformTypesRecursively never pairs, refusing unrelated merges isSignDependentIntegerWidening pairs exactly what the transformation pairs
5 Provenance recorded from the parsed value, so -0 was not recognised Recorded from the written sign
6 A field written with an explicit + inferred an integer type the value reader stops before It stays a String, exactly as a leading-zero integer already did

⚠️ Confirmed, out of this PR's scope, owner assigned

A nested explicit sign is still unreadable. c=[+1] infers Array(Nullable(Int64)) and then
fails with CANNOT_READ_ARRAY_FROM_TEXT. The guard added here sits at the escaping-rule layer, which
sees only the whole field, so a nested token bypasses it. Measured byte-identical on pristine master,
on the pre-fix branch head and on the final build, so it is pre-existing and unmoved by this PR, and
its error code differs from the one fixed here. Fixing it needs a decision in the nested element
parser rather than a patch at this layer, so I filed it separately instead of widening this PR. The
same question applies to a nested leading zero.

Memory: one retained type identity per negative integer element. Recording provenance retains the
type object it is keyed on. For an input that is one long all-negative array this is linear in the
number of elements: measured +74 MiB at 1e6 elements, +238 at 3e6, +489 at 8e6 against an
equal-length positive control, the last from a 24 MB input which is inside the default 32 MiB
inference limit. The majority of that growth predates this PR (master already inserts one set entry
per negative element); the part this PR adds is the retained owner. A dedup was implemented and
measured during review and removed most of it; the residual needs a different provenance
representation, which is a design question, so it is filed separately rather than guessed at here.

A single-row + field can now be auto-detected as a header. tryDetectHeader treats an
all-String first row as a header candidate, so a two-row TSV/CustomSeparated input whose first
row is +1 now names the column +1. This is the existing behaviour of that path rather than a new
interaction: a first row of 00 or abc already does the same on master. In every shape that moves,
the previous answer was DESCRIBE succeeding and SELECT failing, and
input_format_tsv_detect_header=0 gives the data-preserving read. Deliberately not pinned in a test,
since narrowing it belongs in tryDetectHeader.

💡 Raised and not accepted, with the reason

  • Marking the UInt64 overflow branch was suggested as part of the + fix. It would be dead
    code: transformIntegers only consults marks on Int64 types. The single-row case it was meant to
    address is fixed by the String fallback instead.
  • An unequal-shape union case was reported as needing a refused merge. transformTypesRecursively
    does not pair children once container shapes diverge, so there is no widening there to refuse.

Validation caveat

The 200-run randomized sweep for the final round completed only 24 runs, with one 600 s harness
timeout on 04654 and no result differences. That run was taken on a machine under load average 204,
where the untouched 02969 also slowed from a 5.5 s median to 149.8 s, so the timeout tracks machine
load rather than the test. The clean sweeps behind this branch are the earlier full ones
(200/200, 100/100, 100/100, 100/100 with zero failures); on a quiet machine 04654 runs in 5-6 s.

Session id: cron:clickhouse-review-slot-10:20260803-152900

@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (a-i)
# Check Answer
a Deterministic repro? Yes. SELECT * FROM format(TSKV, unhex('633D5B305C783245355D0A')) (that is c=[0\x2E5]) fails Code: 130 CANNOT_READ_ARRAY_FROM_TEXT on every run of an unmodified-master build, while DESC of the same bytes succeeds with Array(Nullable(Float64)). No randomization, no timing, no concurrency. 8 such carriers, all deterministic. The negative-integer carriers are equally deterministic: x=-1 then x=18446744073709551615 fails Code: 27 on a build carrying only the first two commits.
b Root cause explained? Yes, three linked defects. (1) TSKVSchemaReader::readRowAndGetNamesAndDataTypes read the field with readEscapedString, which decodes escape sequences, while TSKVRowInputFormat::readRow calls deserializeTextEscaped on the original buffer, so inference and reading answered questions about two different strings. (2) TSKV never overrode transformTypesIfNeeded, so cross-row merging used the base ISchemaReader's bare tryGetLeastSupertype instead of the escaped rule's transformInferredTypesIfNeeded. (3) Fixing (2) newly reaches transformIntegers, which rewrites Int64 to UInt64 whenever a UInt64 is present and consults JSONInferenceInfo::negative_integers to spare negative literals; the non-JSON entry points hardcoded a null pointer, leaving is_negative unconditionally false, so a negative literal was rewritten to unsigned and could not be read back.
c Fix matches the root cause? Yes, one layer per defect. Inference reads the same bytes the value path reads (readTSVField); the merge is routed through the escaped rule; and the provenance pointer that both tryInferNumber and transformInferredTypesIfNeededImpl<false> already support end to end is forwarded instead of dropped. No band-aid: no widened bound, no reduced dataset, no no-random-* tag, no defensive check at the throw site, and specifically no top-level type-keyed guard (measured to be structurally blind to Array/Tuple carriers, which is the same ceiling that made #112226's isNumber guard miss nested values). Three alternatives were rejected with measurements: a recursive leaf guard (regresses 6 shapes that read correctly today because the escape sits inside a quoted element), declining the merge behind a top-level isInt64/isUInt64 test (fixes 1 of 4 negative carriers, so it would have shipped 3 regressions), and changing the shared value path (wrong layer, shared with TSV/CSV/CustomSeparated/SerializationDynamic).
d Test intent preserved / new tests added? Yes. New 04653_tskv_schema_inference_escaped_values, 14 groups plus a writer round-trip row, and a new companion 04654_tskv_schema_inference_union_mode.sh with 5 sections (union mode needs real files, so it cannot be expressed with format()): the fixed carriers, the scalars already fixed by #112226, escape-free controls, quoted-element controls, the merge half, the doubled-backslash carrier, truncated escapes, the negative-integer carriers, the widening that must survive, the pre-existing intra-container rows asserted as unchanged, the negative-map-key carriers with their four must-not-regress controls, and the equal-type-collapse carriers in both row orders and both array-element orders, plus the map key/value collapse carriers with the negative-last control and both must-not-mark controls, and the intra-row map carriers (a single row holding both a negative and a UInt64-range integer, for the key list, the value list and one nesting level) with their two must-still-unify controls. Every DESC has a paired SELECT (checked programmatically for unpaired). 04648's group 15 is retitled and strengthened: it previously asserted DESC only, and now also asserts the two reads that succeed. No test weakened, none deleted, no assertion loosened; the 04653 reference grew as a pure append in every round (this round: first 105 lines byte-identical).
e Demonstrated in BOTH directions? Yes, from the same test files against fourteen builds whose identity was verified per arm (SELECT lower(buildId()) equals readelf -n; that assertion caught a stale-server measurement mid-run, which was discarded and re-measured). Unmodified master: 04653 FAIL (rc 130), 04648 FAIL (rc 27), 02969 FAIL. Mutation arms this round: the map key-side carry removed -> 04653 FAIL Code: 27 on the key carrier while the value carrier passes; the value-side carry removed -> 04653 FAIL Code: 563 on the value carrier while the key carrier passes; the sign-guard normalization reverted -> 04654 FAIL. With the fix: all OK.
f General across CODE paths? Yes. Sibling sweep: every other EscapingRule::Escaped schema reader (TabSeparated*, CustomSeparated, Values) already goes through FormatWithNamesAndTypesSchemaReader, which already uses readTSVField plus transformInferredTypesIfNeeded, so TSKV was the only outlier on the decode half. Of the five IRowWithNamesSchemaReader subclasses, JSONEachRow and JSONObjectEachRow already override the merge, BSONEachRow is binary and Form is URL-encoded, so no sibling fix is owed. On the provenance half the shared-arm fix reaches CustomSeparated, Template and Regexp, which already thread a JSONInferenceInfo, but the equal-type collapse override is per reader, so all three were given it explicitly rather than left to inherit half the correction; measured per format, both row orders plus a no-negative control each: CustomSeparated with format_custom_escaping_rule='Escaped' goes from Nullable(UInt64) plus Code: 27 to Nullable(String) reading both rows and now agrees with the opposite order, and Regexp and Template with their own Escaped rules likewise. All three now have executed cases rather than a shared-code argument: Regexp in 04653 group 15b, and Template in 04654 section 7 because its input format takes the row format only as a schema file path. On unmodified master the Regexp rows silently read the negative value back as 0 and the Template rows fail the read with Code: 27, while the no-negative control is identical on both arms, so neither guard is over-broad. SerializationDynamic also passes an inference info but constructs it as a function local per field, so it never spans rows and needs no override. TSV and CSV pass no pointer and are byte-identically unchanged, verified on both builds. A further code-path gap of the same shape was found by cold review and closed: the array element transform forwarded the provenance but the MAP element transform, two statements below it, did not, so a single row unifying -1 with 18446744073709551615 inside one map still widened the negative key. Measured on both arms: pre-fix Map(UInt64, Nullable(Int64)) plus Code: 27 for the key list and Map(String, Nullable(UInt64)) plus Code: 563 for the value list, nested included; post-fix all three read back, with two non-negative/two-negative controls byte-identical on both arms. Fixed at the source, not guarded at the crash site.
g Generalizes across INPUTS? Yes. The reader swap removes the type-keyed predicate entirely, so there is no wrapper left to strip; this is strictly wider than #112226's removeNullable(recursiveRemoveLowCardinality(...)). Verified: Array, Array(Array), Tuple, Map, Date, DateTime, Bool, Nullable, LowCardinality. The provenance half needs no per-shape work because tryInferArray, tryInferTuple and tryInferMapOrObject already forward the pointer down the recursion, which is what covers the nested negative carriers a top-level test cannot see; measured across scalar, Array, Array(Array), Tuple and a three-row scalar. Boundary inputs asserted: empty value, doubled backslash, truncated \xA and \x, dangling \ at EOF, UInt64 max, Int64 min side (-1 with -2, no UInt64 present, must not widen). The intra-row axis is covered as well as the cross-row one: a map holding both literals in ONE row is unified inside the map inference rather than through the row merge, and both element lists plus one nesting level are asserted. 49 shapes measured across both arms.
h Backward compatible? Yes. No setting default changes, so no SettingsChangesHistory.cpp entry is required (the diff contains no settings file). The two new function overloads are additive: the existing signatures are byte-identical and become one-line forwards passing nullptr, so every existing call site compiles and behaves unchanged. The user-visible type changes are enumerated in the description: an escaped value now infers String, a field written with an explicit + now infers String instead of an integer type the value reader stops before, and merging now performs Int to Float, Int to UInt and nested widening, all aligning TSKV with its sibling formats. format_tsv_null_representation is now honoured by TSKV inference for the first time.
i Invariants and contracts preserved? Yes. The name-read path is deliberately untouched: readName is shared by the schema reader and the value path, so they already agree, and 02125_tskv_proper_names_reading passes on both arms. The value path itself is unchanged. Passing a non-null JSONInferenceInfo on the non-JSON instantiation is safe by inspection of all 11 json_info-> sites: every unconditional dereference sits inside an if constexpr (is_json) block, the two remaining writes are null-checked and operate on a set whose only writer is is_json-gated (so it stays empty here), and the one read whose answer would differ between null and non-null-but-empty (transformJSONNumbersBackToString) is reached only after an if constexpr (!is_json) return; early return in the same lambda. The escaped-rule contract "infer from the bytes you will parse" is now upheld rather than violated, and the merge no longer proposes a type its own value path rejects.

Mutation matrix. Fourteen independently load-bearing pieces across five rounds (the latest round adds two: the structural pairing in the sign guard, whose reversion flips exactly the one union row it exists to allow while the matched-shape refusal stays put; and the keepalive dedup, whose reversion returns the measured RSS gap while the dangling-pointer coverage still passes). Groups are measured in isolation, because a whole-file run against a mutation that aborts at an early group would report later groups red purely by absence. Every arm was a real build (0 FAILED: lines, Build ID moved off the baseline), and the source was restored afterwards with md5 verified against the pre-mutation copy.

Groups 1-7 existed when the first two pieces were mutated; groups 8-10 were added with the third piece and are covered by the two provenance arms. A dash means the group did not exist when that arm was built, not that it passed.

build g1 g2 g3 g4 g5 g6 g7 g8 g9 g10 02240 / 02247
fix OK OK OK OK OK OK OK OK OK OK PASS
reader swap reverted RED RED OK OK OK RED RED - - - PASS
merge override reverted OK OK OK OK RED OK OK - - - DIFFERS
numeric guard from #112226 restored on top OK OK OK OK OK OK OK - - - PASS
provenance dropped on the inference call OK OK OK OK OK OK OK RED OK OK PASS
provenance dropped in the escaped arm OK OK OK OK OK OK OK RED OK OK PASS

Reverting the merge override alone reddens only the merge group and breaks 02240_tskv_schema_inference_bug and 02247_names_order_in_json_and_tskv with c Nullable(String) instead of Array(Nullable(Int64)), which is what proves the reader swap and the merge alignment are one fix rather than two. The two provenance arms redden the negative-integer group and nothing else: group 9 (the widening that must survive) and group 10 (the pre-existing intra-container rows) stay byte-identical, which is what proves both ends of the threading are needed and that neither end over-reaches. Threading only one end is a measured no-op. Restoring #112226's numeric guard on top changes nothing, which is what proves it is dead code under the new reader rather than merely redundant.

Reference safety. Exactly two references move, both authorised and both corrections. On unmodified master both files are reproduced byte-for-byte (168/168 lines for 04648), which is what makes those runs valid controls, and on the fix only lines 167-168 of 04648 move. A 494-test sweep over the CustomSeparated, Template, Regexp, TSV, CSV, JSONEachRow, JSONCompact*, JSONColumns, JSONObjectEachRow, MySQLDump, BSONEachRow, schema-inference and desc file(/DESC format( families, same selection and same sandbox on both builds, with the baseline built from this same worktree with only the fix reverted (source md5-identical to HEAD per file) rather than a nightly snapshot. 494 executed per arm, verified by set difference so no timeout truncation can fake a clean diff: baseline 421 OK / 68 FAIL, fix 423 OK / 66 FAIL. The 2 differing tests are exactly this PR's own two tests, each confirmed to have run in both arms; 0 fix-attributable regressions and no unauthorised reference moved. The 66 failures shared by both builds are sandbox gaps (no ZooKeeper, no writable access storage, shell paths) failing identically either way. The 11 failures shared by both builds are external-dependency tests (user files, s3, obfuscator, grants, shell paths) that fail identically either way. 02240, 02247, 02125_tskv_proper_names_reading and 00310_tskv are green on both arms. The latest round widened that feature-scoped sweep to include the sibling formats this PR activates (adding the CustomSeparated, Regexp, Template and Variant families to the TSKV, schema_inference, infer and escap families): 354 executed per arm, again with the baseline built from this same worktree with only the 13 PR source files reverted to the merge base, per-file md5-verified, and again asserted by set difference (ran_only_in_base and ran_only_in_fix both empty): baseline 309 OK / 43 FAIL, fix 313 OK / 39 FAIL, 0 regressions, and the 4 differing tests are exactly this PR's own 04648, 04653, 04654 and 02969 (whose reference this PR corrects), each re-run three times on the baseline arm and failing deterministically there rather than being flaky. The 39 failures shared by both arms carry identical reason text in each (having stderror, return code). 02517_infer_uint64_in_case_of_int64_overflow, the in-tree pin for Int64/UInt64 inference across CSV/TSV/JSONEachRow, is in the selection and green on both arms.

50/50. --test-runs 50 with randomization enabled: earlier rounds over 04653, 04654, 04648 and 02969 gave 200 OK, 0 FAIL; each later round re-ran the two changed tests, 04653 and 04654, giving 100 OK, 0 FAIL (50 each) every time. No tags added to either new test.

Round 3 additions (three AGREEd blockers). Three further paths lost the negative-integer
provenance while the merge still consulted it. (1) tryInferMapOrObject passed a null inference info
when inferring a non-JSON map KEY, three lines above where it passes it for the map VALUE, while
transformTypesRecursively does descend into key types; the fix is one argument and lands in the
shared layer, so it also fixes two CustomSeparated shapes that fail on master with the same read
error. This is the only carrier in the PR reachable from ClickHouse's own writer output: SELECT map(-1, 1) AS m FORMAT TSKV emits it, and the test asserts the round trip through formatRow rather
than hex. (2) The record is keyed on the type object's identity, so dropping one of two equal types
loses it: chooseResultColumnType returns early on equals() keeping the first row's object, and
tryInferArray keeps only the last element's object. Both now carry the record over first; the
shared-header site does so through a new virtual that defaults to a no-op and is overridden only by
the TSKV reader, so no other format's behaviour can move through it. Each site is separately
mutation-proven. (3) Cross-file union mode merges through a fresh stateless reader, so no provenance
exists there and a sign-dependent widening cannot be proven safe; it is now declined, which restores
master's loud inference-time refusal instead of a schema that returns part of the data and then fails.
Two union-mode differences from master remain (1.5 against a UInt64-range value, and true against
1); both were measured to predate this round and both align TSKV with what its sibling formats
already do on master.

Round 5 additions (two AGREEd blockers, two AGREEd majors). (1) tryInferArray has two further
collapses AFTER the element types are transformed, and the transformation can make unequal types equal
(replacing a Nothing element is what does it), so those collapses drop element objects too; both now
carry the record over, and the non-JSON one now also receives the inference info it was silently
dropping. That second half additionally fixes a row this PR had shipped as a documented known gap:
c=[-1,18446744073709551615] used to infer Array(Nullable(UInt64)) and then fail to read its own
bytes, and now infers Nullable(String) and reads back. The two halves are proven to fix DIFFERENT
cells: reverting only the argument reddens that row and not the new ones; reverting only the two carry
loops reddens the new c=[NULL,-1,1] carrier and not that row. (2) The record was keyed on a raw
pointer, so an address freed by one column's merge and reused by another column's type was read as
negative, silently declining a correct widening; measured as an order-dependent wrong answer for the
same data. The set is now private and every write goes through an accessor that takes an owning
pointer and retains it, so recording without retaining is a compile error rather than a convention.
(3) On master tryInferDataTypeByEscapingRule discarded the inference info its callers passed, so no
escaped-rule reader had a live record; threading it activates the mechanism for CustomSeparated,
Regexp and Template as well, and all three now get the same collapse override as TSKV. Each was
measured order-dependent before and order-independent after, with a no-negative control that must still
widen. CSV, TabSeparated, MySQLDump, Values, Form and hive partitioning pass no inference
info and are re-verified unaffected by grep. (4) The union-mode sign guard reported any positional
shape mismatch, which declined merges containing no integer at all; it was narrowed to the sign
question, so separate-file and same-file inference agree again for shapes with no sign hazard while the
hazard itself is still declined. Round 6 refined that narrowing further (see below).

Round 6 and 7 additions. (1) The union-mode sign guard now pairs the two shapes the way the
transformation itself would: Nullable is peeled at every level, a container is descended into only
when both sides are the same container kind, and once the shapes diverge the answer is false, because
the transformation never pairs the integers past that point and there is no widening there to decline.
The earlier "an Int64 on one side and a UInt64 anywhere on the other" test refused merges that
carried no sign hazard at the paired positions; 04654 section 6 pins the corrected behaviour, where a
non-corresponding pair merges into a Variant instead. (2) The provenance record no longer retains a
duplicate owner when an already-recorded identity is re-marked, which is what carrying it across a
collapse does to the surviving object; measured to remove 14.9 MB at 1e6 elements and 122.6 MB at 8e6.
One residual remains and is tracked separately: inference allocates a distinct type object per array
element, so the number of recorded identities is proportional to the element count. That is not
introduced here (master already inserts one set entry per negative element on the JSON path); what this
PR adds is the owning pointer that makes each entry safe to read. Compacting it needs provenance that
is not keyed on per-element type identity, i.e. a redesign of a structure shared with the JSON readers,
which is a different concern from "TSKV infers from the bytes it parses". (3) The map element transform
gap described in (f) above.

Session id: cron:clickhouse-impl-slot-41:20260801-154003

Round 8 additions (one AGREEd blocker plus its coverage). Provenance was recorded from the PARSED
VALUE, so two token families inferred Int64 unmarked and were then widened to UInt64 and could not
be read back: a signed zero (-0, -00, -000), whose value is not negative, and a literal with an
explicit plus (+0, +1), which readIntTextImpl accepts. The predicate now tests the sign the
literal is WRITTEN with, at both recording sites, which is the property the value path actually
refuses: readIntTextImpl rejects '-' for an unsigned target and readIntTextUnsafe, which the
escaped text deserializer reaches, reads no '+' at all and stops before it.

(a) deterministic, single statement, no randomization: DESC/SELECT over x=-0 then
x=18446744073709551615. (e) both directions with asserted binary identity on three arms (pristine
master, the pre-round build, the fixed build): 14 shapes go from a hard error (Code: 27 / 130 /
563) back to exactly what pristine master answers for the same bytes, across scalar, two-row and
three-row, Array, Array(Array), Tuple, Map key, Map value and Array(Map). (f) the fix is
at the shared recording sites, so all four escaped-rule readers move together and each was measured;
CustomSeparated and Regexp now read these tokens back where master gave a wrong unsigned answer (on
Regexp master silently read -0 back as 0, a wrong-results shape rather than an error), Template
is covered by three new 04654 rows, and the no-negative controls are byte-identical on every arm so
the guard is not over-broad. The remaining value-based site is the JSON parser
(JSONExtractTree.cpp), which has no literal text to inspect; that is documented at
markNegativeInteger rather than left implicit. (g) -0 / -00 / -000 / +0 / +1, each at
every container shape, plus the float sibling -0.0 and the single-row cases. Values, Dynamic,
Form and MySQLDump, which pass no persistent inference info, are byte-identical between master and
this build (whole-probe diff empty).

One of the new carriers is reachable from ClickHouse's own writer, so this is not a hand-written-bytes
concern: formatRow('TSKV', -0.0::Float64 AS x) emits exactly x=-0, verified as hex 783D2D300A,
and that row concatenated with the writer's UInt64-max row is asserted in 04653 as a round trip
alongside the existing group-11 one.

Mutation (this round). Reverting the predicate alone (both sites back to the value test, the helper
still referenced so the mutation isolates only the predicate) reddens 04653 and 04654 and leaves
04648 and 02969 green. The boundary is exact rather than approximate: 04653's first divergence is
reference line 208, the first new carrier, and head -207 is md5-identical between reference and mutant
output, so every pre-existing group passes; 04654's first divergence is line 44 with head -43
md5-identical. Group 13c was also run in ISOLATION on the mutant and fails at its first carrier, so it
is live on its own and not merely as part of a longer file. Restored afterwards with both source md5s
verified and the Build ID back to the pre-mutation value.

Sweep. The 97-test schema-inference selection on both arms, same harness, identity asserted per arm:
zero fix-only failures. The only master-only failures are this PR's own three updated tests, and the
10 failures shared by both arms are environmental (S3, cluster, URL, async insert) and fail identically
either way. 50/50 with randomization enabled over all four tests: 200 OK, 0 FAIL.


Round-9 addendum: the + half of the sign predicate is now scoped to the readers that refuse a +.

The predicate above recorded both signs at two call sites that every escaping rule and the JSON path
share. That is right for -, which every integer reader refuses for an unsigned target, and wrong for
+: readIntTextUnsafe (src/IO/readIntText.h:399-412) stops before a +, but readIntText
(:53-92) accepts one with no signedness guard and reads +1 as 1. The JSON value reader is the
second one, so marking + globally made {"a":"+1"} next to a UInt64-range row fail
TYPE_MISMATCH under input_format_json_try_infer_numbers_from_strings = 1, on input that reads on
master.

The predicate is now split by sign rather than by call site: a - always records, a + records only
when the caller states that its value reader refuses one. That condition travels as an explicit
parameter defaulting to the safe answer, set on the escaped and raw arm of
tryInferDataTypeByEscapingRule alone. It is deliberately NOT keyed on the is_json template
argument, because tryInferNumberFromStringImpl<false> serves both a no-provenance entry point and a
JSON one, so that argument does not discriminate them.

(e) both directions, two independent mutation arms, exact boundaries. Reverting the scoping (+
unconditional again) reddens only 04653, first divergence at reference line 241, the new group 13d
carrier, with head -240 md5 identical between reference and mutant output. Separately, forcing the
flag false on the escaped/raw arm reddens only 04653, first divergence at line 211, the group 13c
x=+1 row, head -210 md5 identical: that second arm is what proves the flag is read rather than
defaulted everywhere.

(f)/(g). The parameter is threaded through every internal path that can reach a marking site
(array, tuple, map key and value, quoted string, number, JSON object and JSON paths), so nested
carriers behave like scalar ones. All 14 TSKV carriers and the CustomSeparated, Regexp and
Template siblings are byte-identical to the previous round (48-row per-row probe, diff empty), and
the JSON - behaviour is byte-identical too: over an 11-row JSON probe exactly one row moves, the +
carrier, back to master's answer.

Tests. 04653 gains group 13d, which asserts the same +1 token under both readers side by
side, with the - and no-sign controls beside it and the opt-in setting written per query. The
reference diff is additions only, 294 -> 304 lines, zero removed. This PR previously had no JSON
coverage at all, which is why the regression could pass the whole suite. 04654, 04648 and 02969
references are unchanged. Four tests green; 50/50 with randomization on: 200 OK, 0 FAIL.

@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

cc @Avogar @tavplubix, could you review this? TSKV schema inference read each field with readEscapedString, which decodes escape sequences, while the value path parses the original bytes, so DESCRIBE proposed a type SELECT then refused on the same input; inference now reads the raw bytes and TSKV gets the escaped rule cross-row merge it never had, which also required threading the negative-integer provenance that tryInferDataTypeByEscapingRule was discarding for every escaped-rule reader.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e2d4772]

Summary: ✅


AI Review

Summary

The PR makes TSKV infer types from the original field bytes, fixing unreadable inferred types for escaped dates and compound values while preserving default \N handling. One existing major finding remains: malformed escapes newly pass schema inference even though the inferred String cannot read them. No new inline findings were identified.

Missing context / blind spots
  • ⚠️ No local ClickHouse binary was available for execution. The findings were verified against the current code and regression-test expectations; completed functional-test results for head e2d47729033f04703b77aee735c4084a4b738ce7 were not available during this review.
Findings

⚠️ Majors

  • src/Processors/Formats/Impl/TSKVRowInputFormat.cpp:273: Schema inference should reject an inspected field when no inferred type can deserialize it. Unlike readEscapedString, readTSVField does not validate escape sequences. Consequently, DESC format(TSKV, unhex('783D315C780A')) now succeeds with Nullable(String), whereas SELECT on the same bytes fails with CANNOT_PARSE_ESCAPE_SEQUENCE. The equivalent 783D315C78410A case also describes successfully and fails on read. Group 7 of 04653_tskv_schema_inference_escaped_values.sql explicitly confirms this regression. Validate escape syntax while preserving the original bytes for type inference, and make those DESC assertions expect rejection. This is the existing open finding; no duplicate comment was posted.
Final Verdict

Status: ⚠️ Request changes. Preserve inference-time rejection of malformed escapes without decoding the bytes used for type detection, and update the focused regression assertions accordingly.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 3, 2026
Comment thread src/Formats/EscapingRuleUtils.cpp Resolved
Comment thread src/Processors/Formats/ISchemaReader.h Resolved
@groeneai

groeneai commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - a550fdf

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens.

Check / test Reason Owner / fixing PR
AST fuzzer (arm_asan_ubsan) / Logical error: Invalid number of columns in chunk pushed to OutputPort. Expected 0, found 1 (STID 2270-3258) Trunk bug, not caused by this diff. Failing query is SELECT DENSE_RANK() IGNORE NULLS OVER (RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM remote('127.0.0.{4..6}', view(SELECT 65537 AS a)) SAMPLE 1 / 1000, aborting in RemoteSource::prepare (src/Processors/Sources/RemoteSource.cpp:102) with Chunk: UInt32(size = 1): the analyze-only header drops the unused constant projection of the view(...) subquery while the remote side still streams it. This PR only changes schema inference for TSKV/Template/Regexp/CustomSeparated and touches no planner or distributed-read path. 4 hits across 4 unrelated PRs in 30 days. #108045 (mine, open)
Build (arm_release) / Post Hooks build_profile_hook telemetry INSERT rejected with LogCluster query failed with code 500; the job's own conclusion is success (the hook carries allow_failure), so no build was gated. 676 Post Hooks FAIL rows across 286 distinct PRs in the last 24 hours. a fix task is created (investigating at full effort - fixing PR link to follow on this PR)

The remaining 173 check-runs on this head are success (156) or skipped (18). No Sync check ran
on this PR.

Session id: cron:our-pr-ci-monitor:20260804-050000

@Avogar Avogar self-assigned this Aug 5, 2026
@groeneai

groeneai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Closing the loop on one thing I said above. In the round-7 notes I described the remaining
per-element provenance identity as "tracked separately"; I have now measured it and am not
pursuing it, so that tracking is closed rather than pending.

Measured on unmodified master (25d677a44eb4be5), JSONEachRow, default settings, peak RSS from
/usr/bin/time -f %M, byte-identical inputs, so none of this involves this PR:

input negative Int64 positive Int64 negative Float64
40 MB 1426 MiB 1135 MiB 1123 MiB
160 MB 4756 MiB 3790 MiB not measured

The negative-float column is the control that identifies the mechanism: -1.5 carries the same
sign and the same byte count but is never recorded in negative_integers, and it costs what the
positive arm costs. So the delta really is the provenance set.

It is not worth a change, for two reasons I had wrong before measuring. First, the cost is not
bounded by input_format_max_bytes_to_read_for_schema_inference: cutting that setting 32x
(32 MB to 1 MB) moves peak RSS on the 160 MB file from 4750 MiB to 4747 MiB, because
ReadSchemaUtils.cpp:287 only tests the budget once rows_read != 0, and the comment just above
it notes the row is completed past the limit, so a single large field is read in full at any
setting. Second, once that is understood the dominant term is sign-independent: the positive arm
alone is 3790 MiB, about 25x the input, and the provenance adds 26% on top of that. Compacting it
would turn 25x into 20x while leaving the unbounded read exactly as it is, and it would touch a
structure shared with JSONEachRow, JSONCompactEachRow, JSONObjectEachRow, JSONColumns* and
the escaped-rule readers. Wrong thing to spend a change on, and the unbounded first-row read is
the part that would matter if anyone reports an OOM.

Nothing here affects this PR's diff; the keepalive stays, since it fixes the address-reuse defect
pinned by 04653 group 14.

@groeneai groeneai added the groeneai-origin-follow-up PR origin: groeneai's own out-of-scope finding during its PR work label Aug 19, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). label Sep 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Dear @Avogar, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@groeneai

Copy link
Copy Markdown
Collaborator Author

This branch conflicts with master, and the conflict is semantic rather than textual, so I am not resolving it as it stands.

#113910 (merged 2026-09-15) repaired readIntTextUnsafe so the Escaped/Raw family reads zero-padded and +-signed integers, which leaves the + half of this branch without a premise. There is exactly one textual conflict, the Raw/Escaped arm of tryInferDataTypeByEscapingRule in src/Formats/EscapingRuleUtils.cpp, and the two sides now disagree on behavior. Measured on a master build at 61124de86664e1, which contains #113910:

DESC   format(TSV, '+007')  ->  Nullable(Int64)      SELECT -> 7
DESC   format(TSV, '+7')    ->  Nullable(Int64)      SELECT -> 7
SELECT count() FROM format(TSV, '+1\n123\n456\n')    ->  3

04812_tsv_int_leading_zeros group 5 pins the first two, and it is green on master (466 runs in the last three days). This branch demotes an integer-inferring field whose first character is + to String, measured on 2026-08-05 against a transplant build (+1, +42, +0, +007, +00 all move from Nullable(Int64) to Nullable(String)). Keeping that side would fail the test, and it would drop the third line from 3 rows to 2, because TSV header auto-detection then consumes the String first row.

What master does not carry is unaffected, and all three of these still reproduce on the same binary:

DESC   format(TSKV, unhex('783D323032302D30312D305C7833310A')) -> Nullable(Date)
SELECT ...                          -> Code: 27, Found garbage after field in TSKV format
DESC   format(TSKV, unhex('633D5B305C783245355D0A')) -> Array(Nullable(Float64))
SELECT ...                          -> Code: 130, Cannot read array from text, found '\'
DESC   format(TSV, '-1\n18446744073709551615\n')     -> Nullable(UInt64)
SELECT ...                          -> Code: 27, Cannot parse input

The first two are why reading the TSKV field with readTSVField is still worth having: the guard on master tests only the top-level inferred type, so an escape inside a Date or inside a nested value keeps inferring a type the value path cannot read. The third is the negative-integer provenance.

So the scope here should be cut to those, with the + guard and its reader_refuses_plus plumbing dropped, instead of rebasing the present shape. I am reworking it on that basis and will report the outcome here.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Outcome of the conflict decision I promised to report above.

The PR is now TSKV-only: two src/ files, 36 changed lines. The + demotion and its plumbing are
gone, because merged #113910 repaired readIntTextUnsafe, so master reads +007 and pins it as
Nullable(Int64) in 04812 group 5. src/Formats/EscapingRuleUtils.cpp is byte-identical to master
again, which is what the single textual conflict was, so git merge-tree against current master is
clean.

One behaviour change beyond the escape fix. A field equal to the null representation stops decoding to
the empty string, so it infers Nullable(Nothing) and now takes part in the cross-row merge, where a
null and a container have no plain supertype and this format's String default would discard the
container type. A merge override scoped to that pair keeps it, which is what keeps
02240_tskv_schema_inference_bug's existing reference. Every pair the plain supertype already
resolves keeps master's answer, because that merger runs first.

What this no longer carries, and a question for you. The escaped-rule family keeps its
negative-integer defect: format(TSV, '-1\n18446744073709551615\n') infers Nullable(UInt64) and
then fails with Code: 27, and the same holds for CustomSeparated, Regexp and Template under
the Escaped rule, while CSV answers Code: 72. I cut it here because the unconditional
escaped-rule merge it relied on regressed TSKV's own -1 case into that identical unreadable
Nullable(UInt64), and because the sign record it threaded never reached the TSV reader at all. The
code for it is in this branch's history. Do you want it as its own PR?

Internal second-model review of the reworked head (adjudicated)

An independent model reviewed this head cold and I adjudicated its findings against the code and the
recorded measurements. The verdicts are mine.

Changed as a result of this review

Finding Change
The changelog entry opened in the past tense Reworded to the present tense, per docs/changelog_entry_guidelines.md
The description claimed four mutation controls, each reddening a different cell Three redden. The ordering of the merge override reddens nothing on today's master; the description now says so and keeps that ordering only as a defensive bound
The description claimed the 692-test sweep over the untouched format families moves nothing It moves one test, the 04648 this PR updates on purpose. Corrected

Confirmed, disclosed, not changed here

The moved cell is readable because input_format_null_as_default defaults to 1. With a custom
null representation and that setting at 0, a null row merged with a container now infers the container
and the read fails with Code: 130, where master inferred String and read it. I am not fixing that
here, and not because it is merely older than the diff:

  • master already behaves this way at the default representation: 02240 types its column c as
    Array(Nullable(Int64)) over a c=\N row and prints [], and since that type is not nullable the
    [] can only come from the null-as-default branch, so at input_format_null_as_default=0 master's
    own reference would fail on its first row;
  • 04653 group 5 pins, at default settings and identically on both arms, a TSKV column that infers
    Array(Nullable(Int64)) and whose SELECT fails with Code: 130, so this PR does not claim to
    have eliminated that class, only the decode asymmetry;
  • every other escaped-rule reader merges unconditionally and ignores input_format_null_as_default.
    Consulting it here would make TSKV the only format whose inferred type depends on that setting, and
    would then require it in the schema-cache key, which means changing the shared inference code this
    rework deliberately returned to master.

At input_format_null_as_default=0 a container column cannot represent the null that was declared, so
refusing the read is a defensible answer and it is the one master gives. Say the word if you would
rather have the String fallback there.

Noted, not blocking

  • A pre-existing gap this PR pins rather than fixes. An empty field merged with a container
    (x= then x=[2]) still infers a type its own read rejects, because the empty-field branch returns
    before the null-representation branch. Byte-identical on both arms, so it is pinned as a
    serverError cell rather than quietly repaired, which would have widened the PR.
  • One test comment overstates a mechanism. Group 6 says the cross-row merge "was skipped" on
    master for x=\\N paired with x=1; the plain supertype in fact resolves that pair to
    Nullable(Int64), which is how the second row's type wins. The outcome described is right.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, no randomization. SELECT * FROM format(TSKV, unhex('783D323032302D30312D305C7833310A')) (x=2020-01-0\x31) is Code: 27 on unmodified master and reads 2020-01-01 here; c=[0\x2E5] is Code: 130. DESCRIBE succeeds on both arms, so the schema and the read disagree.
b Root cause explained? TSKVSchemaReader::readRowAndGetNamesAndDataTypes read the field with readEscapedString, which decodes, while TSKVRowInputFormat::readRow parses the original bytes, so inference classified bytes that are never parsed. TSKV was the only escaped-rule reader that decoded before inferring.
c Fix matches root cause? Yes: the schema reader now reads the same bytes the value path parses (readTSVField). #112226's byte-count guard is deleted rather than extended, because a byte count cannot classify a nested value.
d Test intent preserved / new tests added? 04653 covers seven carriers: container, date and datetime escapes, escaped scalars, escape-free controls, an escape inside a quoted element, the cross-row merge with its bounds, a doubled backslash, truncated escapes. 04648 group 15 now asserts its TSKV reads too. 04654 is deleted, not weakened: per-file schemas are finalized before the union merger, so its cells answer identically on both arms.
e Both directions demonstrated? Two binaries from this worktree differing only in these two files: 04653 dies on unmodified master at group 1's first SELECT (Code: 130) and is byte-identical to its reference here, through the same harness. 24 of 72 statements move, every one a claimed change.
f Fix is general across code paths? Fixed at the source (the read), not guarded at the failure site. The sibling escaped-rule readers (TSV, CustomSeparated, Regexp, Template) already read the raw field, so they need nothing, and a 692-test sweep over the tsv, csv, custom_separated, regexp, template and json families moves nothing.
g Fix generalizes across inputs? Escape position, escape form (\xNN, \0, truncated \x, bare trailing \, doubled \\), inferred type and the merge matrix (null+container, null+scalar, null+tuple, Int64+UInt64, Int64+Float64, empty+container) are all asserted. LowCardinality needs no peeling before onlyNull(): the escaped-rule inference path never constructs it, and DataTypeLowCardinality::onlyNull() is false, so such a type would decline the rescue and keep master's answer.
h Backward compatible? No setting added or changed, so no SettingsChangesHistory.cpp entry; no format version, no schema-cache key. Two inferred types change, both deliberately: an escaped field infers String and is now readable, and a null row merged with a container yields the container type, which 02240_tskv_schema_inference_bug's existing reference already expects.
i Invariants and contracts preserved? The base ISchemaReader::transformTypesIfNeeded runs first, which makes this a strict addition: whenever the plain supertype exists, master's answer is kept by construction. chooseResultColumnType only ever passes two non-null unequal types, so no null check is added, and readTSVField leaves the buffer at the same delimiter readEscapedString did, so the caller's loop is unchanged.

Session id: cron:clickhouse-impl-slot-40:20260916-134600

`TSKVSchemaReader::readRowAndGetNamesAndDataTypes` read each field with
`readEscapedString`, which decodes escape sequences, while
`TSKVRowInputFormat::readRow` parses the original bytes. Inference therefore
answered a question about bytes that are never parsed, so `DESCRIBE` succeeded and
`SELECT` on the same input failed: `c=[0\x2E5]` inferred `Array(Nullable(Float64))`
from the decoded `[0.5]` and then stopped at the backslash with
`CANNOT_READ_ARRAY_FROM_TEXT`, and `x=2020-01-0\x31` inferred `Date` and failed
with `CANNOT_PARSE_INPUT_ASSERTION_FAILED`.

The schema reader now uses `readTSVField`, which does not decode. TSKV was the
only escaped-rule reader that decoded before inferring. ClickHouse#112226's numeric guard
tested only the top-level inferred type, so an escape inside a `Date` or inside a
container still inferred an unreadable type; it is dead now and removed, together
with the three includes it needed.

Reading raw has one consequence for null fields. A field equal to the null
representation stops decoding to the empty string, so it would infer
`Nullable(Nothing)`, join the cross-row merge, and let this format's `String`
default discard a container type another row inferred. A field therefore
contributes no type, exactly as the decoded empty string used to, only where the
value path reads it as a null rather than as data: `\N`, and only while `\N` is
the null representation. `SerializationNullable` wants the configured
representation followed by a delimiter, and
`deserializeNullAsDefaultOrNestedTextEscaped` substitutes a default only while
`input_format_null_as_default` is on, so nothing else may step aside. Naming a
container for a row the reader will not accept as a null would rebuild the very
DESCRIBE/SELECT asymmetry this commit removes, and with
`input_format_null_as_default=0` no container type is readable for a column with
null rows at all; inference must not consult that setting either, since it is not
part of the schema-cache key. Restricting it this way is also what keeps
`02240_tskv_schema_inference_bug`'s `Array(Nullable(Int64))`.

Inference thus changes for escaped fields, and for `x=\N` once the null
representation is something else. `x=\N` under a different representation and
`x=\N\N` improve on master, which names a container for them and then cannot read
the null row.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai
groeneai force-pushed the tskv-schema-inference-raw-bytes branch from d61f1ac to 7e2fd3b Compare September 16, 2026 19:22
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 7e2fd3b

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_asan_ubsan) / Cannot start clickhouse-server, Check failed trunk bug: the server does not come back after the stress restart because ATTACH TABLE test_3.t_pfl_05079 (s AggregateFunction(quantile('1'), Float64)) fails with Code 70 CANNOT_CONVERT_TYPE "Cannot convert String to double" (62 legs / 54 unrelated PRs / 6 master shas in 14 days) #119810 (mine, open)
Build profile diff infra: CI logs cluster query failed raised in has_pr_data (build_profile_diff_job.py:723), a fresh recurrence on trees that already carry the merged user fix #118618 (215 legs / 172 unrelated PRs yesterday, 0 master) #120121 (mine, open)
Mergeable Check / PR aggregator cascade of the Stress test (amd_asan_ubsan) row above #119810 (mine, open)

Session id: cron:our-pr-ci-monitor:20260917-003056

@Avogar Avogar self-assigned this Sep 18, 2026

names_and_types.emplace_back(std::move(name), std::move(type));
/// The value path parses the original bytes, so inference must see the field undecoded.
readTSVField(value, in);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using readTSVField here fixes the valid escaped-value cases, but it also stops schema inference from rejecting malformed escapes. For example, DESC format(TSKV, unhex('783D315C78410A')) (x=1\\xA) and ...('783D315C780A') (x=1\\x) now fall through to Nullable(String), yet SerializationString::deserializeTextEscaped still throws on the same bytes. That keeps the same DESCRIBE/SELECT mismatch for malformed input: we are still advertising a type the value path cannot read, only now via the String fallback. Could we validate the raw field with the escaped-string reader before accepting String, and keep schema inference failing when no readable type exists?

@clickhouse-gh

clickhouse-gh Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Commit e2d47729033f04703b77aee735c4084a4b738ce7 was not compared: the CI logs cluster did not answer (exception 241, code 500: { "meta": [ { "name": "file", "type": "LowCardinality(String)" …).

See the job log for details.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - d400d1d

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (arm_release, master_head, 2/6) / read_in_reverse_order_final #0, #1 dashboard confirmed_regression, client_time +41.3% and +26.2% (the shard's report calls #0 unstable). These are FINAL reads of a MergeTree fixture, with no TSKV input and no schema inference. Since #122073 stopped merges during measured runs, the two servers kept different part counts for this fixture. The tested tree fdfbcf892ac0 (this head merged into master at 00:50Z) predates the fixture fix #122335 (mine, merged). The next master merge picks it up: the current head is a maintainer's own master merge, so I am not pushing another one on top of it now
Performance Comparison (arm_release, master_head, 2/6) / serialization_pool_lookup #0 dashboard confirmed_regression, client_time 0.678 -> 0.821 (+20.9%), while the shard's own report does not flag the query. It groups a Dynamic key over numbers_mt(), so no TSKV parsing is involved ClickHouse/performance-comparison#5 (external, open): the dashboard's confidence scoring, where @ fm4v handles these verdicts after #121847, which is present in the tested tree. That repository is not publicly readable, so its state cannot be measured from here
Mergeable Check, PR rollups, red only because of the shard above #122335 (mine, merged) and ClickHouse/performance-comparison#5 (external, open), the owners of the two rows above

All 176 check runs completed (134 pass, 39 not selected, 3 red), Finish Workflow is green and
CH Inc sync passed. CIDB has no FAIL or ERROR test row on this head. The shard's
1 too long is informational: it never fails a shard on its own.

Session id: cron:our-pr-ci-monitor:20260926-063421

@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Dear @Avogar, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@Avogar Avogar self-assigned this Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). groeneai-origin-follow-up PR origin: groeneai's own out-of-scope finding during its PR work pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants