Skip to content

[4.1](column) remove IDataType get_default (#62582)#63308

Open
Mryange wants to merge 2 commits into
apache:branch-4.1from
Mryange:branch-4.1-pick-62582
Open

[4.1](column) remove IDataType get_default (#62582)#63308
Mryange wants to merge 2 commits into
apache:branch-4.1from
Mryange:branch-4.1-pick-62582

Conversation

@Mryange
Copy link
Copy Markdown
Contributor

@Mryange Mryange commented May 16, 2026

What problem does this PR solve?

#62582

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

Mryange added 2 commits May 15, 2026 22:07
Problem Summary:

`IDataType::get_default()` duplicated the default-value behavior already
owned by `IColumn::insert_default()`, but the two paths did not always
produce the same result. This made default materialization inconsistent
for complex and nested types, and forced several code paths to
round-trip through `Field` even when the column layer already had the
correct defaulting semantics.

This change removes the redundant type-level API and makes default
generation consistently follow the column implementation.

- Remove `IDataType::get_default()` from the BE data type interface and
delete all corresponding overrides.
- Rewrite `create_column_const_with_default_value()` to create a column
and materialize its default value through `insert_default()`.
- Replace storage-side callers that used `type->get_default()` with
direct column-level `insert_default()` calls.
- Update unit tests to stop asserting the removed `Field`-based API and
to validate defaults through column behavior instead.

None

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

- Does this need documentation?
    - [x] 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 4955aaf)
@Mryange Mryange requested a review from yiguolei as a code owner May 16, 2026 00:13
@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?

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 16, 2026

run buildall

@Mryange Mryange changed the title [refine](column) remove IDataType get_default (#62582) [4.1](column) remove IDataType get_default (#62582) May 16, 2026
@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 16, 2026

run nonConcurrent

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