You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "adriangb (via GitHub)" <gi...@apache.org> on 2026/07/09 16:40:35 UTC

[PR] refactor: collapse repeated root-level parquet read plan construction [datafusion]

adriangb opened a new pull request, #23426:
URL: https://github.com/apache/datafusion/pull/23426

   ## Which issue does this PR close?
   
   - N/A — follow-up cleanup requested in review of #23396 ([comment](https://github.com/apache/datafusion/pull/23396#discussion_r3552883479)).
   
   **Stacked on #23396.** Please merge that one first; until it lands this PR's diff against `main` also contains its commits. The change reviewable here is the last commit, [`root_level_plan`](https://github.com/apache/datafusion/pull/23396#discussion_r3552883479).
   
   ## Rationale for this change
   
   `build_projection_read_plan` has three early-return paths (all-plain-columns fast path, no-struct-columns fast path, and the no-struct-accesses fallback). Each one repeated the same three-step sequence: `ProjectionMask::roots`, `Schema::project`, then construct a `ParquetReadPlan`. As @mbutrovich noted in review, a small local helper collapses all three.
   
   ## What changes are included in this PR?
   
   - New private `root_level_plan(root_indices, file_schema, schema_descr) -> ParquetReadPlan` in `projection_read_plan.rs`, documenting the precondition that `root_indices` is sorted and deduplicated and that every leaf below each root gets decoded.
   - The three call sites now delegate to it.
   
   Net −9 lines. No behavior change.
   
   ## Are these changes tested?
   
   Yes, by existing tests: `datafusion-datasource-parquet` unit tests (158 pass) and the `parquet_integration` suite in `datafusion` (213 pass), both unchanged.
   
   ## Are there any user-facing changes?
   
   No.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01BsRGsN18YBCji5iFTQmWpr
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] refactor: collapse repeated root-level parquet read plan construction [datafusion]

Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb commented on PR #23426:
URL: https://github.com/apache/datafusion/pull/23426#issuecomment-4928675294

   cc @xudong963 @mbutrovich 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] refactor: de-duplicate parquet read plan construction [datafusion]

Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb merged PR #23426:
URL: https://github.com/apache/datafusion/pull/23426


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org