Skip to content

feat: migrate EmptyExec and PlaceholderRowExec to ExecutionPlan proto hooks#23784

Open
847850277 wants to merge 1 commit into
apache:mainfrom
847850277:feat_23501
Open

feat: migrate EmptyExec and PlaceholderRowExec to ExecutionPlan proto hooks#23784
847850277 wants to merge 1 commit into
apache:mainfrom
847850277:feat_23501

Conversation

@847850277

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Migrates the EmptyExec and PlaceholderRowExec leaf plans while preserving the existing protobuf wire format.

What changes are included in this PR?

  • Implement ExecutionPlan::try_to_proto for EmptyExec and PlaceholderRowExec.
  • Add plan-specific try_from_proto implementations.
  • Route protobuf encoding and decoding through the new hooks.
  • Keep the deprecated helper methods as compatibility shims.

Are these changes tested?

yes

Are there any user-facing changes?

Hi @andygrove , would you be willing to review this PR when you have time? Thanks!

Copilot AI review requested due to automatic review settings July 22, 2026 02:44
@github-actions github-actions Bot added proto Related to proto crate physical-plan Changes to the physical-plan crate labels Jul 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

This PR migrates the EmptyExec and PlaceholderRowExec physical leaf plans to the newer protobuf “plan self-serialization” hooks (ExecutionPlan::try_to_proto / X::try_from_proto) while preserving the existing wire format. This continues the ongoing effort to move protobuf encoding/decoding responsibility closer to each plan type and reduce the central downcast/match chains in datafusion-proto.

Changes:

  • Implement ExecutionPlan::try_to_proto for EmptyExec and PlaceholderRowExec in datafusion-physical-plan.
  • Add plan-specific try_from_proto constructors for EmptyExec and PlaceholderRowExec.
  • Route protobuf decoding through these new hooks and remove the old central encoding downcast arms, keeping deprecated helper methods as compatibility shims.

Reviewed changes

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

File Description
datafusion/proto/src/physical_plan/mod.rs Switch decode match arms to X::try_from_proto, remove central encoding downcast arms for these leaf plans, and keep deprecated helpers as shims delegating to the new hooks.
datafusion/physical-plan/src/placeholder_row.rs Add try_to_proto and PlaceholderRowExec::try_from_proto implementations under feature = "proto".
datafusion/physical-plan/src/empty.rs Add try_to_proto and EmptyExec::try_from_proto implementations under feature = "proto".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).

Details
     Cloning apache/main
    Building datafusion-physical-plan v54.1.0 (current)
       Built [  36.152s] (current)
     Parsing datafusion-physical-plan v54.1.0 (current)
      Parsed [   0.148s] (current)
    Building datafusion-physical-plan v54.1.0 (baseline)
       Built [  35.601s] (baseline)
     Parsing datafusion-physical-plan v54.1.0 (baseline)
      Parsed [   0.152s] (baseline)
    Checking datafusion-physical-plan v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.923s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [  74.440s] datafusion-physical-plan
    Building datafusion-proto v54.1.0 (current)
       Built [  58.751s] (current)
     Parsing datafusion-proto v54.1.0 (current)
      Parsed [   0.020s] (current)
    Building datafusion-proto v54.1.0 (baseline)
       Built [  58.634s] (baseline)
     Parsing datafusion-proto v54.1.0 (baseline)
      Parsed [   0.021s] (baseline)
    Checking datafusion-proto v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.340s] 223 checks: 222 pass, 1 fail, 0 warn, 30 skip

--- failure trait_method_marked_deprecated: trait method #[deprecated] added ---

Description:
A trait method is now #[deprecated]. Downstream crates will get a compiler warning when using this method.
        ref: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-deprecated-attribute
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/trait_method_marked_deprecated.ron

Failed in:
  method try_into_empty_physical_plan in trait datafusion_proto::physical_plan::PhysicalPlanNodeExt in /home/runner/work/datafusion/datafusion/datafusion/proto/src/physical_plan/mod.rs:722
  method try_into_placeholder_row_physical_plan in trait datafusion_proto::physical_plan::PhysicalPlanNodeExt in /home/runner/work/datafusion/datafusion/datafusion/proto/src/physical_plan/mod.rs:722
  method try_from_empty_exec in trait datafusion_proto::physical_plan::PhysicalPlanNodeExt in /home/runner/work/datafusion/datafusion/datafusion/proto/src/physical_plan/mod.rs:722
  method try_from_placeholder_row_exec in trait datafusion_proto::physical_plan::PhysicalPlanNodeExt in /home/runner/work/datafusion/datafusion/datafusion/proto/src/physical_plan/mod.rs:722

     Summary semver requires new minor version: 0 major and 1 minor checks failed
    Finished [ 119.514s] datafusion-proto

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Jul 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.37615% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.69%. Comparing base (5de7f1d) to head (967c518).

Files with missing lines Patch % Lines
datafusion/proto/src/physical_plan/mod.rs 4.44% 43 Missing ⚠️
datafusion/physical-plan/src/empty.rs 83.87% 2 Missing and 3 partials ⚠️
datafusion/physical-plan/src/placeholder_row.rs 84.84% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23784      +/-   ##
==========================================
- Coverage   80.71%   80.69%   -0.02%     
==========================================
  Files        1089     1089              
  Lines      368760   368828      +68     
  Branches   368760   368828      +68     
==========================================
- Hits       297647   297631      -16     
- Misses      53372    53446      +74     
- Partials    17741    17751      +10     

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

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

Labels

auto detected api change Auto detected API change physical-plan Changes to the physical-plan crate proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proto: migrate leaf plans EmptyExec + PlaceholderRowExec

3 participants