Skip to content

[branch-4.1](be) backport storage type/encoding refactor series to branch-4.1 (#63153 #63233 #63622 #63291 #64341) - #64550

Merged
yiguolei merged 5 commits into
apache:branch-4.1from
csun5285:cp-refactor-branch-4.1
Jun 17, 2026
Merged

yiguolei merged 5 commits into
apache:branch-4.1from
csun5285:cp-refactor-branch-4.1

Conversation

@csun5285

Copy link
Copy Markdown
Contributor

pick from master #63153 #63233 #63622 #63291 #64341

@csun5285
csun5285 requested a review from yiguolei as a code owner June 16, 2026 06:21
@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 and others added 5 commits June 16, 2026 14:24
…Type (apache#63153)

Replace TypeInfo* fields and parameters with FieldType throughout the
storage layer, and add a static field_type_size(FieldType) helper that
maps each type to sizeof(CppTypeTraits<FT>::CppType) so size lookups
stay in sync with the existing traits machinery.

(cherry picked from commit 7e5c941)
…ad code (apache#63233)

Drop the `StorageField` wrapper and related dead code. `StorageField`
was a thin layer over `TabletColumn` — every accessor just forwarded,
all 11 subclasses were empty stubs with no caller distinguishing them
via
  dynamic_cast/typeid. After removing it, several dead pieces fell out.

Issue Number: close #xxx

Related PR: #xxx

(cherry picked from commit 8a8999c)
…he#63622)

Replace the EncodingPreference + runtime hook machinery in
EncodingInfoResolver with four explicit maps and four matching get
methods:

  - _v2_default_map     -> get_v2_default_encoding(type)
  - _v3_default_map         -> get_v3_default_encoding(type)
  - _index_column_default_map -> get_index_column_encoding(type)
  - _encoding_map           -> get(type, encoding, out)

No on-disk format change; the resolved encodings written into
ColumnMetaPB match the pre-refactor outputs for both v2 and V3 tablets.

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

None

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [x] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [x] 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 -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 4f1dcdf)
- apache/doris-website#3759

- Problem: The CHAR padding contract leaked from the storage layer into
the
compute / predicate layers — every scan stripped padding at the Block
level,
while predicates re-padded values to match the on-disk shape. Logic was
spread
   out and wasted work on every read.
- Fix: On-disk format unchanged. The convertor still pads CHAR to the
schema
length on write, but the strip is pushed down to the page pre-decoder —
the
page cache holds unpadded data. All shrink_* / pad_* code above the page
cache
   (SegmentIterator, Block, RowCursor, predicates) is removed.
- BloomFilter: BF probing is skipped (return true, fall back to scan)
for CHAR
predicates — the BF hashes padded bytes but predicate values are
unpadded, so
the probe would never match. Other indexes (ZoneMap / inverted / bitmap)
are
  unaffected.

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

None

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [x] 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#3759>

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit e072997)
…che#64341)

1. Make IDataType::get_storage_field_type() derive the field type from
the primitive type
2. SegmentIterator::_is_char_type (and _vec_init_char_column_id) is
deleted

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None

### Check List (For Author)

- 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:
- [x] 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 -->

### 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 -->

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 9d3c35b)
@csun5285
csun5285 force-pushed the cp-refactor-branch-4.1 branch from 9efc449 to 68b95d1 Compare June 16, 2026 06:25
@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 78.59% (613/780) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.01% (20477/37911)
Line Coverage 37.58% (194787/518351)
Region Coverage 33.96% (152168/448106)
Branch Coverage 34.90% (66479/190471)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 89.06% (700/786) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.95% (26669/37066)
Line Coverage 54.99% (284003/516433)
Region Coverage 52.48% (237269/452096)
Branch Coverage 53.66% (102476/190972)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.56% (2/128) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 89.06% (700/786) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.75% (27335/37066)
Line Coverage 57.35% (296165/516433)
Region Coverage 55.05% (248901/452096)
Branch Coverage 56.46% (107829/190972)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.91% (2/219) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 89.06% (700/786) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.75% (27335/37066)
Line Coverage 57.34% (296127/516433)
Region Coverage 55.02% (248721/452096)
Branch Coverage 56.45% (107801/190972)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.91% (2/219) 🎉
Increment coverage report
Complete coverage report

@yiguolei
yiguolei merged commit 228e7b2 into apache:branch-4.1 Jun 17, 2026
28 of 31 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