Repository navigation
Iterate ColumnObject subcolumns in sorted path order - #112601
Merged
Merged
Conversation
`ColumnObject::forEachSubcolumn`, `forEachMutableSubcolumn` and their recursive variants iterated the raw `typed_paths`/`dynamic_paths` `unordered_map`s. The iteration order of an `unordered_map` is not guaranteed to be preserved by its copy constructor, and `IColumn::mutate` clones the column (copy-constructing those maps) when it is shared. `IColumn::convertToFullIfWrapped` collects the unwrapped subcolumns while iterating the source column and then reassigns them positionally while iterating the mutated (possibly cloned) column, so the two passes must visit subcolumns in the same order. If the cloned maps iterated in a different order, converted subcolumns would be assigned to the wrong paths. Iterate the already-maintained `sorted_typed_paths`/`sorted_dynamic_paths` instead, so the visiting order is deterministic and stable across cloning. This is currently latent (the bundled `libc++` happens to preserve copy order), so it is a safety change and not user-visible. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
|
Workflow [PR], commit [40301f7] Summary: ✅
AI ReviewSummaryThis PR makes Tests
Final Verdict
|
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 20/31 (64.52%) · Uncovered code |
kssenii
approved these changes
Aug 10, 2026
This was referenced Aug 10, 2026
clickhouse-gh Bot
added a commit
that referenced
this pull request
Aug 10, 2026
Backport #112601 to 26.7: Iterate ColumnObject subcolumns in sorted path order
alexey-milovidov
added a commit
that referenced
this pull request
Aug 12, 2026
Backport #112601 to 26.5: Iterate ColumnObject subcolumns in sorted path order
alexey-milovidov
added a commit
that referenced
this pull request
Aug 12, 2026
Backport #112601 to 26.3: Iterate ColumnObject subcolumns in sorted path order
alexey-milovidov
added a commit
that referenced
this pull request
Aug 12, 2026
Backport #112601 to 25.8: Iterate ColumnObject subcolumns in sorted path order
kssenii
added a commit
that referenced
this pull request
Aug 13, 2026
Backport #112601 to 26.6: Iterate ColumnObject subcolumns in sorted path order
VighneshPath
pushed a commit
to VighneshPath/ClickHouse
that referenced
this pull request
Aug 24, 2026
…n sorted path order
kewin-robetti
pushed a commit
to viasoftkorp/ClickHouse
that referenced
this pull request
Aug 24, 2026
…n sorted path order
kewin-robetti
pushed a commit
to viasoftkorp/ClickHouse
that referenced
this pull request
Aug 24, 2026
…n sorted path order
VighneshPath
pushed a commit
to VighneshPath/ClickHouse
that referenced
this pull request
Sep 16, 2026
…n sorted path order
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
JSON: ColumnObject iterated its typed/dynamic path columns in hash-map order -> JSON join keys with several paths miss in the exact-values runtime filter. Effect in the production build a394e92: without it the 04327_join_runtime_filter_json case with two JSON paths still returns 0 after the ClickHouse#107663 backport (a33ab46) on the candidate 91efe1f244ce, deterministically and with join_runtime_filter_exact_values_limit = 0 as the only workaround; official 26.8.8.8 returns 1. The 26.3 branch merged this backport (ClickHouse#114224, 2026-08-12) before the ClickHouse#107663 backport (ClickHouse#109074, 2026-09-05), so the upstream test passed there. Upstream patch unchanged, with its test(s): -. No test of its own; 04327_join_runtime_filter_json (from the ClickHouse#107663 backport) is the regression test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bytehalo-infra
added a commit
to sentioxyz/ClickHouse
that referenced
this pull request
Sep 25, 2026
…f upstream fixes The stateless selection gets the upstream tests of the 34 backports of the residual audit and of the two backports they depend on (ClickHouse#99085, ClickHouse#107562), 04627 (runnable with the gate's loopback Keeper), and 10317/10318 (Parquet Decimal512): 152 tests. 04670 (needs pyarrow) and 00900 (a long load test whose skip list changed) run outside the gate. known_defects.json: a fixed KD-UP entry per backport (fixed_by = its commit); KD-UP-108790 points at the ClickHouse#115705 backport, which carries its change; KD-UP-107663 records its ClickHouse#112601 dependency. Defects found by the release gate on the candidate 91efe1f244ce and fixed: KD-D512-PERF-OVERFLOW-CHECKS (e91167f), KD-TEST-BLOCKCHAIN-TYPENAME (f006d0d), KD-GATE-NO-KEEPER (095b89c). 80 entries, 0 open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
ColumnObject::forEachSubcolumn,forEachMutableSubcolumnand their recursive variants iterate over the already-maintainedsorted_typed_paths/sorted_dynamic_pathslists instead of the rawtyped_paths/dynamic_pathsunordered_maps.Motivation: the iteration order of an
unordered_mapis not guaranteed to be preserved by its copy constructor, andIColumn::mutateclones the column (copy-constructing those maps) when it is shared.IColumn::convertToFullIfWrappedcollects the unwrapped subcolumns while iterating the source column and then reassigns them positionally while iterating the mutated (possibly cloned) column, so both passes must visit subcolumns in the same order. If the cloned maps iterated in a different order, converted subcolumns would be assigned to the wrong paths.Iterating the sorted path lists makes the visiting order deterministic and stable across cloning, removing the reliance on unspecified
unordered_mapcopy-order behavior. This is currently latent — the bundledlibc++happens to preserve copy order — so it is a safety change with no user-visible effect.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Version info
26.8.1.1131(included in26.8and later)26.7.4.17,26.6.3.32,26.5.7.40,26.3.18.22,25.8.30.14