Skip to content

fix(proto): preserve AnalyzeExec metric types across serialization - #24669

Open
haohuaijin wants to merge 2 commits into
apache:mainfrom
haohuaijin:fix-analyze-metric-types-proto
Open

fix(proto): preserve AnalyzeExec metric types across serialization#24669
haohuaijin wants to merge 2 commits into
apache:mainfrom
haohuaijin:fix-analyze-metric-types-proto

Conversation

@haohuaijin

@haohuaijin haohuaijin commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

AnalyzeExec::metric_types was lost during protobuf round-trips, causing non-default selections such as summary-only metrics to reset to [Summary, Dev].

What changes are included in this PR?

  • Serialize and deserialize AnalyzeExec::metric_types.
  • Preserve compatibility with older protobuf messages.
  • Distinguish an absent field from an explicitly empty metric type list.
  • Add regression tests for summary, dev, empty, and legacy states.

Are these changes tested?

Yes.

  • Relevant datafusion-proto integration tests
  • Clippy for the affected crates
  • Formatting and diff checks

Are there any user-facing changes?

Yes. EXPLAIN ANALYZE metric type selections now survive physical-plan protobuf serialization. There are no public Rust API changes.

@github-actions github-actions Bot added proto Related to proto crate physical-plan Changes to the physical-plan crate labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

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 v55.0.0 (current)
       Built [  43.662s] (current)
     Parsing datafusion-physical-plan v55.0.0 (current)
      Parsed [   0.156s] (current)
    Building datafusion-physical-plan v55.0.0 (baseline)
       Built [  38.280s] (baseline)
     Parsing datafusion-physical-plan v55.0.0 (baseline)
      Parsed [   0.159s] (baseline)
    Checking datafusion-physical-plan v55.0.0 -> v55.0.0 (no change; assume patch)
     Checked [   1.054s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [  85.158s] datafusion-physical-plan
    Building datafusion-proto v55.0.0 (current)
       Built [  54.507s] (current)
     Parsing datafusion-proto v55.0.0 (current)
      Parsed [   0.020s] (current)
    Building datafusion-proto v55.0.0 (baseline)
       Built [  54.520s] (baseline)
     Parsing datafusion-proto v55.0.0 (baseline)
      Parsed [   0.020s] (baseline)
    Checking datafusion-proto v55.0.0 -> v55.0.0 (no change; assume patch)
     Checked [   0.157s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [ 110.703s] datafusion-proto
    Building datafusion-proto-models v55.0.0 (current)
       Built [  25.469s] (current)
     Parsing datafusion-proto-models v55.0.0 (current)
      Parsed [   0.137s] (current)
    Building datafusion-proto-models v55.0.0 (baseline)
       Built [  24.944s] (baseline)
     Parsing datafusion-proto-models v55.0.0 (baseline)
      Parsed [   0.141s] (baseline)
    Checking datafusion-proto-models v55.0.0 -> v55.0.0 (no change; assume patch)
     Checked [   2.399s] 223 checks: 222 pass, 1 fail, 0 warn, 31 skip

--- failure constructible_struct_adds_field: struct exhaustively constructible through public API adds field ---

Description:
A pub struct that could be exhaustively constructed with a literal using only public API has a new pub field, breaking existing exhaustive literals.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field AnalyzeExecNode.has_metric_types in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2124
  field AnalyzeExecNode.metric_types in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2127
  field AnalyzeExecNode.has_metric_types in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2124
  field AnalyzeExecNode.metric_types in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2127

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

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

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.84848% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.48%. Comparing base (63f5b55) to head (858933f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/proto-models/src/generated/pbjson.rs 70.00% 2 Missing and 7 partials ⚠️
datafusion/physical-plan/src/analyze.rs 97.22% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24669      +/-   ##
==========================================
+ Coverage   81.44%   81.48%   +0.04%     
==========================================
  Files        1118     1118              
  Lines      399550   399661     +111     
  Branches   399550   399661     +111     
==========================================
+ Hits       325398   325675     +277     
+ Misses      55154    54915     -239     
- Partials    18998    19071      +73     

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

2 participants