Repository navigation
Parse numeric 1/0 as Bool inside containers - #109976
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260710-100400 |
|
Workflow [PR], commit [dfdee5a] Summary: ❌
AI ReviewSummaryThis PR fixes the Findings❌ Blockers
Final VerdictChanges requested. |
Fix update — Fast test regression on 03158 addressed (head 0aba3a7)The first attempt ( Root cause: Fix: gate the Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260710-110300 |
|
Added |
|
Added opt-in-direction coverage in |
|
The Fixed in 2afe737: reverted
Verified with clickhouse-local against the fixed binary. |
|
Good catch — the JSON path was still ungated. Fixed in 339f658.
The numeric Verified against
|
CI finish ledger — 339f658All checks finished (Finish Workflow success). The PR's own numeric- The remaining red checks are pre-existing/unrelated to this PR. Each has an owner:
None of these touch Bool serialization; they are not caused by this PR's diff. Session id: cron:clickhouse-worker-slot-12:20260710-210200 |
CI finish ledger — 339f658Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. All three failures are pre-existing / unrelated to this PR's diff (SerializationBool.cpp + 04510 regression test); confirmed by 30-day cross-PR spread.
Session id: cron:our-pr-ci-monitor:20260710-213000 |
Avogar
left a comment
There was a problem hiding this comment.
It's 2 complitely different fixes. One - bug in not advancing position during parsing of 1/0 as Bool in deserializeTextQuotedImpl. Second - not gating 1/0 as under allow_special_bool_values. The PR description and changelog mention that this a fix for the first issue, and changes were very confusing to me. Split changes with allow_special_bool_values into a separate PR.
|
Agreed, splitting. #109976 will keep only the position-advance fix in |
SerializationBool::deserializeTextQuoted handled the numeric forms 1/0 by inserting the value without advancing the read position, unlike the true/false and quoted-value branches. The container reader then saw the same digit where it expected a comma or closing bracket and failed with CANNOT_READ_ARRAY_FROM_TEXT for inputs like [1,0]. Advance the position in the 1/0 cases like every other branch. Closes: ClickHouse#109882 Co-Authored-By: Claude Opus 4.8 <[email protected]>
339f658 to
e888c65
Compare
The position-advance fix in deserializeTextQuotedImpl lets Bool consume bare 1/0 to EOF, so the Variant deserializer (Bool has higher priority than integers) now selects Bool instead of falling through to UInt32. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
The bot's analysis is correct and I want to surface the tension it creates with the split.
The one signal that separates the two contexts is the setting itself:
The catch: that gate is an Which split do you prefer?
I lean A: it makes #109976 a pure container fix with zero Variant/Dynamic behavior change. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 10/11 (90.91%) · Uncovered code |
CI finish ledger — dfdee5aEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
#111029's merge commit Session id: cron:our-pr-ci-monitor:20260727-170000 |
|
Cross-reference from #110835, where the AI reviewer raised the ungated quoted carrier. Recording it here because this is the PR that makes those branches reachable. On That is the bug this PR fixes. The side effect is that the branches become accepting while still ungated, so bare The
No change pushed for this comment. |
d4f94c2
Closes: #109882
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix parsing of numeric
1/0asBoolvalues inside container types (e.g.Array(Bool),Tuple(Bool, ...)). Previously[1,0]failed withCANNOT_READ_ARRAY_FROM_TEXTwhile[true,false]worked.Description
SerializationBool::deserializeTextQuoted(the element reader used byArray/Tupletext parsing and by CSV array elements) handled the numeric forms1/0by inserting the value without advancing the read position, unlike thetrue/falseand quoted-value branches. The container reader then saw the same digit where it expected a comma or closing bracket:Scalar
Boolwas unaffected. The one-line fix advances the position for the1/0cases like every other branch. Verified[1,0], mixed[true,0,1,false],Array(Nullable(Bool)),Tuple(Bool,Bool)text, and CSV all parse correctly whiletrue/false, the quoted'1'form, and scalarBoolremain unchanged. Regression test added in04510_bool_numeric_in_containers.Version info
26.8.1.448(included in26.8and later)