Repository navigation
Conversation
Internal second-model review (11 rounds, adjudicated)An independent model reviewed this branch cold at each round, and the findings below were adjudicated ❌ Fixed as a result of reviewEleven fix rounds; the substantive ones, in order:
|
Pre-PR validation gate (a-i)
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 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.
Reverting the merge override alone reddens only the merge group and breaks 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 50/50. Round 3 additions (three AGREEd blockers). Three further paths lost the negative-integer Round 5 additions (two AGREEd blockers, two AGREEd majors). (1) Round 6 and 7 additions. (1) The union-mode sign guard now pairs the two shapes the way the Session id: cron:clickhouse-impl-slot-41:20260801-154003 Round 8 additions (one AGREEd blocker plus its coverage). Provenance was recorded from the PARSED (a) deterministic, single statement, no randomization: One of the new carriers is reachable from ClickHouse's own writer, so this is not a hand-written-bytes Mutation (this round). Reverting the predicate alone (both sites back to the value test, the helper Sweep. The 97-test schema-inference selection on both arms, same harness, identity asserted per arm: Round-9 addendum: the The predicate above recorded both signs at two call sites that every escaping rule and the JSON path The predicate is now split by sign rather than by call site: a (e) both directions, two independent mutation arms, exact boundaries. Reverting the scoping ( (f)/(g). The parameter is threaded through every internal path that can reach a marking site Tests. |
|
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. |
|
Workflow [PR], commit [e2d4772] Summary: ✅
AI ReviewSummaryThe PR makes Missing context / blind spots
Findings
Final VerdictStatus: |
CI finish ledger - a550fdfEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The remaining 173 check-runs on this head are Session id: cron:our-pr-ci-monitor:20260804-050000 |
|
Closing the loop on one thing I said above. In the round-7 notes I described the remaining Measured on unmodified master (
The negative-float column is the control that identifies the mechanism: It is not worth a change, for two reasons I had wrong before measuring. First, the cost is not Nothing here affects this PR's diff; the keepalive stays, since it fixes the address-reuse defect |
|
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. |
|
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
What master does not carry is unaffected, and all three of these still reproduce on the same binary: The first two are why reading the TSKV field with So the scope here should be cut to those, with the |
|
Outcome of the conflict decision I promised to report above. The PR is now TSKV-only: two One behaviour change beyond the escape fix. A field equal to the null representation stops decoding to What this no longer carries, and a question for you. The escaped-rule family keeps its 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 Changed as a result of this review
Confirmed, disclosed, not changed hereThe moved cell is readable because
At Noted, not blocking
|
Pre-PR validation gate (click to expand)
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]>
d61f1ac to
7e2fd3b
Compare
CI finish ledger - 7e2fd3bEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20260917-003056 |
|
|
||
| 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); |
There was a problem hiding this comment.
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?
Build profile diff (arm_release)Commit See the job log for details. |
CI finish ledger - d400d1dEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
All 176 check runs completed (134 pass, 39 not selected, 3 red), Session id: cron:our-pr-ci-monitor:20260926-063421 |
|
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. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes
TSKVschema inference proposing a type theTSKVvalue path cannot read, soDESCRIBEsucceeded whileSELECTon the same input failed withCANNOT_PARSE_INPUT_ASSERTION_FAILED,CANNOT_READ_ARRAY_FROM_TEXTorCANNOT_READ_MAP_FROM_TEXT. Inference now reads the raw field bytes, the same bytes the value path parses.Description
TSKVSchemaReader::readRowAndGetNamesAndDataTypesread each field withreadEscapedString, which decodes escape sequences, whileTSKVRowInputFormat::readRowparses the original bytes. Inference therefore answered a question about bytes that are never parsed:c=[0\x2E5]inferredArray(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;TSKVwas the only escaped-rule reader that decoded before inferring. #112226's numeric guard tested only the top-level inferred type, so an escape inside aDateor 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'sStringdefault 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\Nis the null representation. That keeps02240_tskv_schema_inference_bug's reference; every other field, including the textNULLand\Nunder a different representation, carries bytes the reader must parse and merges like any other value.Inference thus changes for escaped fields, and for
x=\Nonce the null representation is something else.x=\Nunder a different representation andx=\N\Nimprove on master, which names a container for them and then cannot read the null row.Validation:
04653covers seven carriers and fails on unmodified master; its null cells are measured against master on ten inputs across bothinput_format_null_as_defaultarms; a 239-test sweep of theschema_inference,tskv,tsv,csv,custom_separated,regexpandtemplatefamilies 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]