[refine](column) separate mutable subcolumn mutation from read-only traversal#65087
Open
Mryange wants to merge 1 commit into
Open
[refine](column) separate mutable subcolumn mutation from read-only traversal#65087Mryange wants to merge 1 commit into
Mryange wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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.
What problem does this PR solve?
Column wrappers used
for_each_subcolumnfor both read-only traversal and mutable subcolumn detachment during COW mutation. These two operations have different contracts: read-only paths only needconst IColumn&, while COW mutation needs to replace child pointer slots.Root cause: the old mutable callback accepted
IColumn::WrappedPtr&, but several composite columns store strongly typed child wrappers, such as nullable null maps and array/map offsets. That forced ad-hoc move-out and cast-back bridges, and made read-only callers use mutable traversal orconst_cast.This change keeps
for_each_subcolumnas a const read-only traversal API and addsmutate_subcolumns()for the COW mutation path. Composite columns now detach children throughmutate_subcolumnhelpers, and read-only recursive checks use the const traversal directly. A dedicated BE unit test file verifies that mutating exclusive subcolumns does not introduce extra clones, while shared subcolumns are still detached.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)