Repository navigation
Cherry pick #115329 to 26.3: Fix not applying max_dynamic_subcolumns_in_json_type_parsing for inserts in some cases - #116408
Merged
Conversation
`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]>
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]>
Reshape async-insert columns from first parsed chunk/block
Member
Contributor
Contributor
1 similar comment
Contributor
Author
…ypick/26.3/115329
Contributor
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.
Original pull-request #115329
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job