refactor(proto): migrate sort merge join serde - #23712
Merged
Merged
Conversation
SortMergeJoin serialization still depends on centralized plan downcasts, keeping protobuf ownership separate from the execution plan. Move encoding and decoding behind its ExecutionPlan hooks while preserving existing wire fields. Keep the legacy helpers as deprecated compatibility APIs and verify join enums and sort options roundtrip. Closes apache#23508 Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
|
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23712 +/- ##
========================================
Coverage 80.69% 80.70%
========================================
Files 1088 1089 +1
Lines 367741 368329 +588
Branches 367741 368329 +588
========================================
+ Hits 296761 297258 +497
- Misses 53272 53355 +83
- Partials 17708 17716 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
adriangb
requested changes
Jul 20, 2026
| protobuf::GenerateSeriesName::GsRange => "range", | ||
| } | ||
| } | ||
| #[deprecated( |
Contributor
There was a problem hiding this comment.
Can we have these deprecated methods delegate to the new methods so we avoid code duplication?
SortMergeJoinExec serde now lives in per-plan hooks, but the deprecated PhysicalPlanNodeExt helpers kept independent implementations. Duplicating join, filter, and sort-option conversions allowed the compatibility path to drift from normal dispatch. Build the existing encode and decode adapter contexts in those helpers and forward to SortMergeJoinExec's canonical hooks. Remove the protobuf sort-expression alias that the duplicate encoder no longer needs. Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
kosiew
pushed a commit
to kosiew/datafusion
that referenced
this pull request
Aug 12, 2026
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes apache#23508 . ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> `SortMergeJoinExec` serialization currently depends on centralized encoding and decoding logic in `datafusion-proto`. This keeps protobuf ownership separate from the execution plan and contributes to the central type-dispatch chain tracked by apache#23494. Moving serialization into `SortMergeJoinExec` keeps the implementation with the plan that owns the relevant state and aligns it with the new per-plan serialization model. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> - Add `ExecutionPlan::try_to_proto` for `SortMergeJoinExec`. - Add `SortMergeJoinExec::try_from_proto`. - Preserve serialization of: - Both child plans. - Join-key expressions. - Join type and null-equality behavior. - Optional join filters and column origins. - Per-key sort options. - Convert `JoinType`, `JoinSide`, and `NullEquality` through exhaustive by-name matches. - Route decoding through the plan-local implementation and remove the centralized encoding downcast. - Retain the old public conversion helpers as deprecated compatibility APIs. - Preserve the existing protobuf wire representation. - Expand roundtrip coverage for every join type, both null-equality modes, filters, column origins, and non-default sort options. ## Are these changes tested? Yes <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> There are no runtime behavior or protobuf wire-format changes. The old `PhysicalPlanNodeExt` conversion helpers remain available but are deprecated in favor of the plan-local serialization hooks. --------- Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
SortMergeJoinExecserialization currently depends on centralizedencoding and decoding logic in
datafusion-proto. This keeps protobufownership separate from the execution plan and contributes to the
central type-dispatch chain tracked by #23494.
Moving serialization into
SortMergeJoinExeckeeps the implementationwith the plan that owns the relevant state and aligns it with the new
per-plan serialization model.
What changes are included in this PR?
ExecutionPlan::try_to_protoforSortMergeJoinExec.SortMergeJoinExec::try_from_proto.JoinType,JoinSide, andNullEqualitythrough exhaustiveby-name matches.
centralized encoding downcast.
APIs.
modes, filters, column origins, and non-default sort options.
Are these changes tested?
Yes
Are there any user-facing changes?
There are no runtime behavior or protobuf wire-format changes.
The old
PhysicalPlanNodeExtconversion helpers remain available butare deprecated in favor of the plan-local serialization hooks.