[opt](be) Backport nullable and projection optimizations to branch-4.1 - #66586
Open
Mryange wants to merge 3 commits into
Open
[opt](be) Backport nullable and projection optimizations to branch-4.1#66586Mryange wants to merge 3 commits into
Mryange wants to merge 3 commits into
Conversation
apache#66031) The default nullable function path independently inspected the same null maps when checking for all-NULL arguments, unnesting nullable inputs, and wrapping function results. This caused redundant full null-map scans and made type-level nullable checks difficult to distinguish from runtime NULL-value checks. This change introduces `NullableColumnInfo` to collect the nested column, typed null-map column, constness, and non-NULL count once per input column. The information is reused across nullable unnesting, CAST handling, and result wrapping. It also renames the type-level helper to `has_nullable_argument_type` and preserves the existing copy-on-write behavior by copying nested data only when NULL payloads must be replaced with defaults. (cherry picked from commit a4423dc)
…66085) Projection results were converted to mutable columns before being published. Shared results such as SlotRef columns therefore triggered COW clones and full-column copies. This change keeps scoped output-block reuse while moving exclusive results directly and publishing shared immutable columns after restore. It also makes `ColumnConst` and `ColumnVariant` ownership checks include their nested columns, and uses actual peak memory tracking instead of charging shared input buffers as projection allocations. None - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> (cherry picked from commit c611239)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
run buildall |
1 similar comment
Contributor
|
run buildall |
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.
Related PR: #66031, #66085