[fix](column) ensure cut and clone return fresh column trees#62789
Closed
Mryange wants to merge 1 commit into
Closed
[fix](column) ensure cut and clone return fresh column trees#62789Mryange 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:
|
Contributor
Author
|
/review |
Contributor
|
OpenCode automated review failed and did not complete. Error: Review step was failure (possibly timeout or cancelled) Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
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?
Problem Summary:
IColumn::cut is expected to return a fully independent column tree. The shared implementation already builds the result from clone_empty() and insert_range_from(), so cut should remain a normal helper instead of a virtual override point.
The actual ownership bug was in ColumnConst::clone_resized(). It reused the nested data column, which meant clone_resized() and cut() could still share internal subcolumns with the source column. That breaks the expectation that copy-style column operations return a fresh column tree.
This PR fixes ColumnConst::clone_resized() to deep-clone its nested data and adds a BE unit test that walks subcolumns with for_each_subcolumn to verify that clone_resized() and cut() both return fully fresh column trees for representative column types.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)