Skip to content

[feature](reader) Optimize Complex Type Column Reading with Column Puning - #59249

Closed
kaka11chen wants to merge 1 commit into
apache:branch-4.0from
kaka11chen:cherry-pick-57204_4.0
Closed

[feature](reader) Optimize Complex Type Column Reading with Column Puning#59249
kaka11chen wants to merge 1 commit into
apache:branch-4.0from
kaka11chen:cherry-pick-57204_4.0

Conversation

@kaka11chen

@kaka11chenkaka11chen commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:

Release note

Cherry-pick #57204#58719

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

@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?

@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@kaka11chen
kaka11chen marked this pull request as draft December 22, 2025 08:00
@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage82.14% (1573/1915)
Line Coverage67.16% (28070/41794)
Region Coverage67.68% (13806/20399)
Branch Coverage58.13% (7363/12666)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 61.68% (850/1378) 🎉
Increment coverage report
Complete coverage report

@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage82.14% (1573/1915)
Line Coverage67.16% (28067/41794)
Region Coverage67.68% (13807/20399)
Branch Coverage58.14% (7364/12666)

@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage82.14% (1573/1915)
Line Coverage67.17% (28071/41794)
Region Coverage67.72% (13815/20399)
Branch Coverage58.15% (7365/12666)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 61.68% (850/1378) 🎉
Increment coverage report
Complete coverage report

@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage82.14% (1573/1915)
Line Coverage67.16% (28070/41794)
Region Coverage67.66% (13802/20399)
Branch Coverage58.09% (7358/12666)

…uning (apache#57204)
Problem Summary:
Optimize Complex Type Column Reading with Column Pruning
This PR implements column pruning for complex types (Struct, Array, Map)
to optimize read performance. Previously, Doris would read entire
complex type fields before processing, which was simple to implement but
inefficient when only specific sub-columns were needed.
**Key changes:**
- **FE (Frontend)**: Added column access path calculation and type
pruning
- Collects and analyzes access paths for complex type fields
- Performs type pruning based on access paths
- Implements projection pushdown for complex types
- **BE (Backend)**: Added selective column reading
- Uses columnAccessPath array from FE to identify required sub-columns
- Implements selective reading to skip unnecessary sub-columns
**Performance Improvement**: When a struct contains hundreds or
thousands of columns but the query only accesses a few sub-columns, this
optimization can significantly reduce I/O and improve query performance.
For example, with `struct<int a, int b> s`, when only `s.a` is
referenced, we can avoid reading `s.b` entirely.
**Technical Benefits**: Reduces unnecessary data scanning and decoding
overhead for complex types, aligning with Doris's continuous performance
optimization goals .
- **Lazy Materialization for Complex Type Sub-columns**: Defer
materialization of unused sub-columns
- **Predicate Pushdown for Complex Type Sub-columns**: Push predicates
to storage layer for better filtering
- **Parquet RL/DL Optimization**: Read only repetition levels and
definition levels without data in appropriate scenarios
- **Array Size Optimization**: Read only offset and null values for
`array_size()` operations
- **Null Check Optimization**: Read only offset and null values for `!=
null` checks
Co-authored-by: 924060929 <lanhuajian@selectdb.com>
Co-authored-by: Jerry Hu <mrhhsg@gmail.com>
@kaka11chen

Copy link
Copy Markdown
ContributorAuthor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage82.14% (1573/1915)
Line Coverage67.19% (28080/41794)
Region Coverage67.75% (13821/20399)
Branch Coverage58.17% (7368/12666)

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 64.37% (1104/1715) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage53.34% (18605/34877)
Line Coverage39.12% (172357/440602)
Region Coverage33.76% (133050/394105)
Branch Coverage34.78% (57595/165579)

Sign up for freeto 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

@kaka11chen@hello-stephen@doris-robot