Skip to content

feat(parquet): clip nested wrappers during schema pruning - #24315

Open
buraksenn wants to merge 3 commits into
apache:mainfrom
buraksenn:24122-clip-nested-wrappers
Open

feat(parquet): clip nested wrappers during schema pruning#24315
buraksenn wants to merge 3 commits into
apache:mainfrom
buraksenn:24122-clip-nested-wrappers

Conversation

@buraksenn

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Parquet nested schema pruning currently descends through Struct, List, and LargeList. Narrowing casts through ListView, LargeListView, FixedSizeList, or Dictionary therefore read physical leaves that the cast never consumes.

The issue also listed RunEndEncoded, but its casts do not use DataFusion's name-based nested cast path. Arrow may map nested struct fields positionally, so clipping those values could change results; they must remain a full read.

What changes are included in this PR?

Extend nested schema pruning through matching ListView, LargeListView, FixedSizeList, and Dictionary wrappers while preserving safe full-read fallbacks.

Are these changes tested?

Yes, with new and existing tests.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the datasource Changes to the datasource crate label Aug 12, 2026
@codecov-commenter

codecov-commenter commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.26%. Comparing base (e76f1af) to head (a2fb746).
⚠️ Report is 53 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24315      +/-   ##
==========================================
+ Coverage   81.17%   81.26%   +0.09%     
==========================================
  Files        1109     1112       +3     
  Lines      388033   391801    +3768     
  Branches   388033   391801    +3768     
==========================================
+ Hits       314992   318407    +3415     
- Misses      54501    54682     +181     
- Partials    18540    18712     +172     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kosiew kosiew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@buraksenn,

Thanks for working on this. The new pruning support looks good overall, and I like that RunEndEncoded stays conservative given the positional cast behavior.

I left one non-blocking suggestion around adding a stronger LargeListView reader regression test.

vec![0_i32, 0, 2].into(),
vec![2_i32, 0, 1].into(),
Arc::new(values),
Some(NullBuffer::from(vec![true, false, true])),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also add a reader test for LargeListView similar to the ListView one here? It would be useful to assert the decoded parent and item validity, along with the values. The LargeListView path is a little different because of the 64-bit offsets, so having a reader regression test would give us better coverage than the current type and mask checks alone.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, I've added largelistview case as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clip ListView / Dictionary / FixedSizeList wrappers in nested schema pruning

3 participants