Skip to content

[fix](be) Fill partition columns in TableReader#63773

Merged
Gabriel39 merged 3 commits into
apache:refact_reader_branchfrom
Gabriel39:refactor_0528
May 28, 2026
Merged

[fix](be) Fill partition columns in TableReader#63773
Gabriel39 merged 3 commits into
apache:refact_reader_branchfrom
Gabriel39:refactor_0528

Conversation

@Gabriel39
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: TableReader could map partition columns to physical file columns before checking split partition values, and constant/default expression materialization used the file-local block row count. For scans where partition values should be filled from split metadata, especially when the file-local block row count differs from the batch row count, this could produce incorrect materialized columns.

Release note

None

Check List (For Author)

  • Test: Unit Test
    • Added TableReaderTest.ProjectedPartitionColumnUsesSplitPartitionValue
    • Ran git diff --check -- be/src/format/reader/column_mapper.cpp be/src/format/reader/table_reader.h be/test/format/reader/table_reader_test.cpp
    • Could not run ./run-be-ut.sh --run --filter=TableReaderTest.ProjectedPartitionColumnUsesSplitPartitionValue -j 8 because the local environment has JDK 11 while the script requires JDK 17
    • Could not run build-support/clang-format.sh because llvm@16 is not installed locally
  • Behavior changed: No
  • Does this need documentation: No

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

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: TableReader could map partition columns to physical file columns before checking split partition values, and constant/default expression materialization used the file-local block row count. For scans where partition values should be filled from split metadata, especially when the file-local block row count differs from the batch row count, this could produce incorrect materialized columns.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - Added TableReaderTest.ProjectedPartitionColumnUsesSplitPartitionValue
    - Ran git diff --check -- be/src/format/reader/column_mapper.cpp be/src/format/reader/table_reader.h be/test/format/reader/table_reader_test.cpp
    - Could not run ./run-be-ut.sh --run --filter=TableReaderTest.ProjectedPartitionColumnUsesSplitPartitionValue -j 8 because the local environment has JDK 11 while the script requires JDK 17
    - Could not run build-support/clang-format.sh because llvm@16 is not installed locally
- Behavior changed: No
- Does this need documentation: No
@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?

@Gabriel39 Gabriel39 merged commit ac24a82 into apache:refact_reader_branch May 28, 2026
11 of 13 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.

2 participants