Skip to content

refactor(proto): migrate JsonSource serde - #24178

Merged
adriangb merged 2 commits into
apache:mainfrom
buraksenn:23516-proto-json
Aug 8, 2026
Merged

refactor(proto): migrate JsonSource serde#24178
adriangb merged 2 commits into
apache:mainfrom
buraksenn:23516-proto-json

Conversation

@buraksenn

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Part of epic #23494. Moves JsonSource protobuf serialization from the central dispatch into the source implementation.

What changes are included in this PR?

Add protobuf serialization and deserialization to JsonSource.

Repoint the live decode arm to JsonSource::try_from_proto and remove the old central encode arm. Keep try_into_json_scan_physical_plan as a deprecated compatibility wrapper that delegates to the new implementation.

The protobuf wire format remains unchanged.

Are these changes tested?

Yes. Added roundtrip_json_scan.

Are there any user-facing changes?

The existing PhysicalPlanNodeExt method remains available as a deprecated compatibility wrapper. There is no immediate API removal or wire-format change.

@github-actions github-actions Bot added proto Related to proto crate datasource Changes to the datasource crate labels Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 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-datasource-json v54.1.0 (current)
       Built [  50.940s] (current)
     Parsing datafusion-datasource-json v54.1.0 (current)
      Parsed [   0.014s] (current)
    Building datafusion-datasource-json v54.1.0 (baseline)
       Built [  49.519s] (baseline)
     Parsing datafusion-datasource-json v54.1.0 (baseline)
      Parsed [   0.014s] (baseline)
    Checking datafusion-datasource-json v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.093s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [ 102.039s] datafusion-datasource-json
    Building datafusion-proto v54.1.0 (current)
       Built [  68.058s] (current)
     Parsing datafusion-proto v54.1.0 (current)
      Parsed [   0.020s] (current)
    Building datafusion-proto v54.1.0 (baseline)
       Built [  68.072s] (baseline)
     Parsing datafusion-proto v54.1.0 (baseline)
      Parsed [   0.020s] (baseline)
    Checking datafusion-proto v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.258s] 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_json_scan_physical_plan in trait datafusion_proto::physical_plan::PhysicalPlanNodeExt in /home/runner/work/datafusion/datafusion/datafusion/proto/src/physical_plan/mod.rs:1042

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

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

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.82353% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.05%. Comparing base (c1cb715) to head (6bd87ec).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/datasource-json/src/source.rs 73.07% 3 Missing and 4 partials ⚠️
datafusion/proto/src/physical_plan/mod.rs 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24178      +/-   ##
==========================================
- Coverage   81.05%   81.05%   -0.01%     
==========================================
  Files        1106     1106              
  Lines      382210   382267      +57     
  Branches   382210   382267      +57     
==========================================
+ Hits       309812   309843      +31     
- Misses      54091    54113      +22     
- Partials    18307    18311       +4     

☔ 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 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Opened #24180 to track the scan options that are silently dropped on the wire (JSON newline_delimited and compression type here, CSV terminator in #24177) — pre-existing, not a blocker for this PR.

@adriangb
adriangb added this pull request to the merge queue Aug 8, 2026
Merged via the queue into apache:main with commit eec8b94 Aug 8, 2026
38 checks passed
@buraksenn
buraksenn deleted the 23516-proto-json branch August 8, 2026 20:51
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 datasource Changes to the datasource crate proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants