Skip to content

refactor(parquet): extract InitialDecoderState from the opener decoder-setup block - #24572

Merged
adriangb merged 1 commit into
apache:mainfrom
zhuqi-lucas:pr3/initial-decoder-state
Aug 22, 2026
Merged

refactor(parquet): extract InitialDecoderState from the opener decoder-setup block#24572
adriangb merged 1 commit into
apache:mainfrom
zhuqi-lucas:pr3/initial-decoder-state

Conversation

@zhuqi-lucas

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Split out from #23696 (per @adriangb's decomposition proposal, PR 3).

The decoder-setup block in the opener returns a bare (decoder, rg_plan, has_row_selection) tuple. Giving it a named InitialDecoderState struct keeps the values carried out of the block self-documenting, and means the follow-up feature PR (#23696) adds fields to a named struct instead of reshaping a positional tuple.

What changes are included in this PR?

  • push_decoder.rs: new pub(crate) struct InitialDecoderState { decoder, rg_plan, has_row_selection }.
  • opener/mod.rs: the decoder-setup block returns InitialDecoderState { .. } and is destructured back into the same locals.

Pure refactor, no behavior change.

Are these changes tested?

Covered by the existing dynamic_row_group_pruning integration tests (they drive the opener path); all pass. clippy --all-targets --all-features -D warnings is clean.

Are there any user-facing changes?

No.

…r-setup block

The decoder-setup block in the opener returned a bare
`(decoder, rg_plan, has_row_selection)` tuple. Give it a named
`InitialDecoderState` struct so the values carried out of the block stay
self-documenting as more are added (e.g. by apache#23696).

Pure refactor, no behavior change.

Closes apache#24286.
Copilot AI lite review requested due to automatic review settings August 22, 2026 06:31
@github-actions github-actions Bot added the datasource Changes to the datasource crate label Aug 22, 2026

Copilot AI 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.

Pull request overview

Refactors Parquet decoder setup to use a named InitialDecoderState struct instead of a positional tuple.

Changes:

  • Adds the named decoder state struct.
  • Updates the opener to construct and destructure it.
  • Preserves existing behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
datafusion/datasource-parquet/src/push_decoder.rs Defines InitialDecoderState.
datafusion/datasource-parquet/src/opener/mod.rs Uses the struct during decoder setup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jayzhan211 jayzhan211 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.

👍🏻

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.36%. Comparing base (5f0ba13) to head (f1d67df).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/datasource-parquet/src/opener/mod.rs 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24572      +/-   ##
==========================================
+ Coverage   81.34%   81.36%   +0.01%     
==========================================
  Files        1117     1116       -1     
  Lines      397528   397513      -15     
  Branches   397528   397513      -15     
==========================================
+ Hits       323385   323449      +64     
+ Misses      55225    55123     -102     
- Partials    18918    18941      +23     

☔ 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.

@adriangb
adriangb added this pull request to the merge queue Aug 22, 2026
Merged via the queue into apache:main with commit fc15e25 Aug 22, 2026
38 checks passed
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.

[Follow-up #23696] Extract the initial push-decoder setup into a named struct

5 participants