Skip to content

branch-4.2: [fix](be) Preserve pruned complex types in merge blocks - #69696

Merged
yiguolei merged 1 commit into
apache:branch-4.2from
csun5285:pick_65396_merge_block_to_branch_4.2
Oct 28, 2026
Merged

yiguolei merged 1 commit into
apache:branch-4.2from
csun5285:pick_65396_merge_block_to_branch_4.2

Conversation

@csun5285

@csun5285 csun5285 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Backport the merge-block portion of #65396 to branch-4.2: use the FE-pruned type by column unique ID when constructing merge blocks, retaining the physical type for unpruned columns.

### What problem does this PR solve?

Issue Number: None

Related PR: apache#65396

Problem Summary: Ordered reads of nested struct fields over a rowset with
multiple overlapping segments use pruned sub-column iterators, but the merge
reader creates its intermediate blocks from the full physical schema. The
mismatched child layouts can decode strings into numeric columns, return the
wrong fields, or crash the BE. Backport the merge-block portion of apache#65396 to
branch-4.2: use the FE-pruned type by column unique ID when constructing merge
blocks, retaining the physical type for unpruned columns. Include focused
unit and regression coverage for block reuse and nested field reads.

### Release note

Fix errors and BE crashes when ordered scans read pruned complex columns
across overlapping segments.

### Check List (For Author)

- Test:
    - ASAN BE build and FE build.
    - Unit test: VGenericIteratorsTest.*, all 7 tests passed.
    - Regression test: fault_injection_p0/test_topn_pruned_struct_overlapping_segments.
      The original merge-block construction reproduced E-3110 for TINYINT;
      the same suite passed all 4 queries after restoring the fix.
    - Regenerated the expected output with the regression script; it matches
      the original PR's corresponding generated output byte for byte.
    - clang-format 16 passed. clang-tidy found no diagnostics on changed lines;
      its full run is blocked by an existing unmatched NOLINTEND in core/types.h.
- Behavior changed: Yes. Merge blocks use the requested pruned complex types.
- Does this need documentation: No

Partial backport of 3c43f4c (merge blocks).
@csun5285
csun5285 requested a review from yiguolei as a code owner October 27, 2026 14:10
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (16/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 64.54% (30107/46648)
Line Coverage 49.38% (317951/643848)
Region Coverage 45.21% (256290/566909)
Branch Coverage 46.84% (120833/257996)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (16/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.31% (34572/45303)
Line Coverage 61.13% (390324/638465)
Region Coverage 57.89% (328716/567802)
Branch Coverage 58.93% (151873/257704)

@csun5285 csun5285 changed the title [fix](be) Preserve pruned complex types in merge blocks branch-4.2: [fix](be) Preserve pruned complex types in merge blocks Oct 28, 2026
@yiguolei
yiguolei merged commit 7dee848 into apache:branch-4.2 Oct 28, 2026
55 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants