Repository navigation
Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases - #115329
Conversation
|
Workflow [PR], commit [8848c4b] Summary: ❌
AI ReviewSummaryThis PR adds a per-column Missing context / blind spots
Findings
Final VerdictNeeds follow-up before I would consider the fix complete: the main text-parsing path is repaired, but the LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 139/150 (92.67%) · Uncovered code |
|
Approve was accidential, sorry) |
`max_dynamic_subcolumns_in_json_type_parsing` is applied to the parsed `ColumnObject` instance and not to the type, so it was lost whenever parsed data was aggregated into columns built from the header. `ColumnObject` now keeps a separate `max_dynamic_paths_upper_bound` that `prepareForSquashing` restores `max_dynamic_paths` to, and the new `IColumn::takeDynamicStructureLimitsFrom` carries that bound from the parsed data over to the columns aggregating it. `global_max_dynamic_paths` is left alone on purpose: it takes part in `getName`/`structureEquals`, so narrowing it would make a column mismatch the header built from its own type. Fixes two cases: - an asynchronous insert stored more dynamic paths than the setting allows; - a synchronous insert whose data was split into several blocks kept the limit only when the first block happened to overflow into shared data, because `prepareForSquashing` raised the limit back whenever shared data was empty. Closes: #115319 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`max_dynamic_subcolumns_in_json_type_parsing` was applied only to the column a JSON value is parsed into, so an object nested inside a dynamic path kept the limit of its inferred type instead. Apply it in `ObjectJSONNode`, the single place every object goes through during parsing, so it holds at any nesting depth. Replace `takeExactDynamicStructureFrom` and `takeDynamicStructureLimitsFrom` with one implementation behind two wrappers: both copy the dynamic structure and its limits, and only the exact one fixes the structure so later inserts cannot extend it. Copying the structure is what makes a nested limit travel, because `ColumnDynamic` clones the source's variant column and `cloneEmpty` carries the limits of a nested `ColumnObject` with it. Aggregation of parsed data now uses the non-exact variant, which also fixes an asynchronous insert widening the limit of a nested object while a synchronous one kept it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units101 translation units recompiled, 876 s compile time in total, 101 of them have a recent master baseline. |
A limit that `max_dynamic_subcolumns_in_json_type_parsing` puts on a parsed `ColumnObject` instance now travels with the data: `insertFrom` and `insertRangeFrom` lower the destination's upper bound to the source's. Since insertions recurse, the limit also reaches a JSON column nested inside a `Dynamic` without any per-type plumbing, which is how it survives the aggregation of an asynchronous insert. This replaces taking the structure explicitly at the aggregation sites, so `takeExactDynamicStructureFrom`, the columns implementing it, `StreamingFormatExecutor` and `AsynchronousInsertQueue` all go back to their previous form. Also stop the limit from being discarded by a row that reaches the column before the first parsed object, such as a row where the field is absent or a default inserted into a typed path: lowering the limit does not need an empty column, only that the paths already added fit under it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Backport #115329 to 26.8: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
Backport #115329 to 26.5: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
…olumns_in_json_type_parsing for inserts in some cases
…olumns_in_json_type_parsing for inserts in some cases
Backport #115329 to 26.7: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
…olumns_in_json_type_parsing for inserts in some cases
Cherry pick #115329 to 26.3: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
…json_type_parsing for inserts in some cases
Backport #115329 to 26.6: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
Backport #115329 to 26.3: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases
…olumns_in_json_type_parsing for inserts in some cases
STOR: async inserts into JSON ignore max_dynamic_subcolumns_in_json_type_parsing -> wrong layout. Effect in the production build a394e92: wrong/failing (the upstream test fails on it and passes on official 26.8.8.8; evidence/fix_ci_20260925/upstream_repro/residual/115329.PROD263.txt). Upstream patch unchanged, with its test(s): 05019_async_insert_json_max_dynamic_subcolumns_control_on_parsing, 05020_json_max_dynamic_subcolumns_in_parsing_squashing, 05021_json_max_dynamic_subcolumns_in_parsing_nested_objects, 05022_json_max_dynamic_subcolumns_in_parsing_after_default_rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
closes #115319
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes asynchronous inserts into
JSONcolumns ignoring themax_dynamic_subcolumns_in_json_type_parsingsetting. Previously, an asynchronous insert (async_insert = 1) could store more dynamic paths than the setting allows, giving a different column layout than a synchronous insert with the same settings. The cap is now preserved when asynchronous inserts aggregate parsed data.Workflow [PR]
Sync PR [sync-upstream/pr/115329]
Version info
26.8.1.2008,26.7.6.32,26.6.5.78,26.3.33.16