mrhhsg opened a new pull request, #65591:
URL: https://github.com/apache/doris/pull/65591
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
Nested-column pruning can read only metadata such as null bitmaps or offsets
instead of materializing complete column data. These requests are represented
by typed `META` access paths.
Previously, parts of FE planning and BE column readers assumed that every
access path used `data_access_path`. A typed metadata path could therefore lose
its type, arrive at BE with an empty data payload, or be routed as a normal
nested field. Legacy sentinel paths could also conflict with real struct fields
named `NULL` or `OFFSET`.
This PR adds end-to-end typed metadata access-path support:
- Preserve the access-path type through FE expression collection,
normalization, sorting, and nested-column pruning.
- Serialize a compatibility data-path mirror for rolling upgrades from a new
FE to an old BE.
- Select the corresponding data or metadata payload in BE readers according
to the access-path type.
- Normalize legacy metadata sentinel paths from old FEs while prioritizing
real struct children with the same names.
- Correctly route metadata paths for nullable, string, array, map, struct,
and scalar columns.
- Preserve metadata paths through casts only when the source and target leaf
types are identical; otherwise, conservatively fall back to reading complete
data.
- Keep Variant paths on the existing data-read path when metadata-only
reading is unsupported.
### Release note
Fix metadata-only nested-column pruning for nullable and variable-length
nested columns.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- `nereids_rules_p0/column_pruning/string_length_column_pruning`
- `nereids_rules_p0/column_pruning/null_column_pruning`
- `nereids_rules_p0/column_pruning/nested_container_offset_pruning`
- [x] Unit Test
- FE: 74 tests passed in `PruneNestedColumnTest` and
`DescriptorToThriftConverterTest`
- BE: 44 tests passed in `ColumnReaderTest` and
`SlotDescriptorTest.AccessPathsPreservedThroughProtobuf`
- [ ] 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? -->
Additional validation:
- `./build.sh --be --fe -j 48`
- `build-support/check-format.sh`
- `git diff --check origin/master...HEAD`
- `build-support/run-clang-tidy.sh --build-dir be/ut_build_ASAN --base HEAD`
was attempted but could not complete because of a pre-existing unmatched
`NOLINTEND` in `types.h` and a missing toolchain `stddef.h`; it is not counted
as a passing check. Manual log-to-diff alignment found no diagnostics on
changed lines.
- Behavior changed:
- [ ] No.
- [x] Yes. Metadata-only access paths are now routed by their explicit
type while retaining rolling-upgrade compatibility with old FE and BE versions.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]