Repository navigation
Write the empty statistics flag for bucketed Maps in JSON shared data - #118577
Conversation
Write the empty-statistics flag in `NONE` mode so the reader does not consume the first data byte as the flag. Add a runtime `Map` regression without indexes. Related: ClickHouse#113022 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=113022&sha=91ffe2256869399ef0d1de513518842fa44eb60b&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29
Honor the existing statistics mode for `Map` reads. Advanced shared data has no statistics; legacy prefixes omit the flag that corrected writers include. Seek subsequent substreams using their recorded marks so both layouts read correctly, including nested maps. Load marks lazily for whole paths and read their metadata once per granule. Keep all writers and serialization versions unchanged. Ordinary bucketed `Map` columns and JSON `map_with_buckets` keep their existing behavior. Add an actual pre-fix part regression covering full paths, subcolumns, arrays of maps, nested JSON, and rewriting with the current writer. It fails on the original CI binary and passes with the changed reader. Related: ClickHouse#113022
Honor `read_statistics` in the shared `Map` reader while preserving the released writer layout. Remove the extra statistics flag and the substream seeking workaround introduced for it. Sequential compact readers now consume exactly the bytes written, including without substream marks. Cover compact reads, subcolumns, rewriting, and merging without indexes; retain the real pre-fix part regression. Update the `Native` specification. Related: ClickHouse#113022
After `INSERT SELECT` and `OPTIMIZE`, verify runtime types and typed subcolumn reads for the legacy shared-data and compact-part regressions. Both tests pass on the current PR binary at `7801b63bde51d0ec5486a6ab01b6154ea4acc459`. ClickHouse#113022 (comment) ClickHouse#113022 (comment)
Only `StatisticsMode::NONE` omits both the presence flag and payload. `StatisticsMode::PREFIX_EMPTY` writes a false flag without the payload. These part-storage streams remain separate from the `Native` wire format. ClickHouse#113022 (comment)
Keep runtime-type and indexed-query coverage while the bucketed `Map` reader fix remains separate. Remove the pins after the reader fix merges. Related: ClickHouse#118577 Related: ClickHouse#113022
|
Hey @Avogar can you add 'can be tested' and approve the workflow? |
|
Workflow [PR], commit [c5423cf] Summary: ✅
AI ReviewSummaryThis PR extends the deserialization statistics gate to bucketed Final Verdict✅ No blocking issues found in the current diff; no new inline review comments. LLVM Coverage ReportMeasured on commit c5423cf.
Changed lines: Changed C/C++ lines covered: 27/27 (100.00%) · Uncovered code |
Backport #118577 to 26.9: Write the empty statistics flag for bucketed Maps in JSON shared data
Backport #118577 to 26.8: Write the empty statistics flag for bucketed Maps in JSON shared data
…or bucketed Maps in JSON shared data
…or bucketed Maps in JSON shared data
Backport #118577 to 26.7: Write the empty statistics flag for bucketed Maps in JSON shared data
…d Maps in JSON shared data
Backport #118577 to 26.3: Write the empty statistics flag for bucketed Maps in JSON shared data
Bucketed
Mapserialization omitted the statistics-presence byte whenwrite_statisticsisNONE, whiledeserializeBucketsInfoStatePrefixalways reads it.advancedJSON shared data uses this mode, so runtime maps could consume the first data byte as a flag and fail withCANNOT_READ_ALL_DATAorINCORRECT_DATA.New parts now write the empty-statistics flag. The reader also recognizes the legacy unversioned layout, including compact parts without substream marks, so parts already written by the feature branch remain readable. Rewrites preserve the disabled-statistics layout and retained runtime
Maptypes.Regression tests cover new parts, legacy wide and compact parts, and rewrites.
Related: #113022
Failure report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=113022&sha=91ffe2256869399ef0d1de513518842fa44eb60b&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix reading bucketed runtime
Mapvalues fromJSONcolumns usingadvancedshared-data serialization.Workflow [PR]
Sync PR [sync-upstream/pr/118577]
Version info
26.10.1.1860-master(included in26.10and later)26.9.14.7,26.8.22.7,26.7.28.7,26.3.50.6