Skip to content

[fix](be) Fix missing decimal precision and scale for legacy decimal data (#65419)#65522

Open
jacktengg wants to merge 1 commit into
apache:branch-4.1from
jacktengg:4.1-pick-dec-precision
Open

[fix](be) Fix missing decimal precision and scale for legacy decimal data (#65419)#65522
jacktengg wants to merge 1 commit into
apache:branch-4.1from
jacktengg:4.1-pick-dec-precision

Conversation

@jacktengg

Copy link
Copy Markdown
Contributor

Issue Number: close #xxx

Pick #65419

Related PR: #26572, #63569

Problem Summary:

Segments written before decimal ColumnMetaPB precision and scale were persisted can miss precision and scale for decimal types in metadata . Regular columns, complex decimal children may then build decimal DataType instances without the logical precision/scale from TabletSchema, and result in error "Wrong precision 0, min: 1, max: 76". This change centralizes decimal metadata recovery from TabletSchema, applies it before ColumnReader/DataType creation.

Fix reading legacy decimal whose segment metadata is missing decimal precision and scale.

  • Test

    • 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

  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
  • Yes.

  • Confirm the release note

  • Confirm test cases

  • Confirm document

  • Add branch pick label

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@jacktengg jacktengg requested a review from yiguolei as a code owner July 13, 2026 06:53
@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?

@jacktengg

Copy link
Copy Markdown
Contributor Author

run buildall

…data (apache#65419)

Issue Number: close #xxx

Related PR: apache#26572, apache#63569

Problem Summary:

Segments written before decimal ColumnMetaPB precision and scale were
persisted can miss precision and scale for decimal types in metadata .
Regular columns, complex decimal children may then build decimal
DataType instances without the logical precision/scale from
TabletSchema, and result in error "Wrong precision 0, min: 1, max: 76".
This change centralizes decimal metadata recovery from TabletSchema,
applies it before ColumnReader/DataType creation.

Fix reading legacy decimal whose segment metadata is missing decimal
precision and scale.

- 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 -->
@jacktengg jacktengg force-pushed the 4.1-pick-dec-precision branch from c12b026 to 493be2e Compare July 13, 2026 07:42
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 89.13% (41/46) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 54.81% (20955/38234)
Line Coverage 38.25% (200208/523388)
Region Coverage 34.72% (157232/452911)
Branch Coverage 35.66% (68609/192372)

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.

2 participants