Proto: migrate file sink serialization#23781
Draft
Phoenix500526 wants to merge 5 commits into
Draft
Conversation
DataSinkExec needs a generic way to delegate protobuf encoding to its wrapped sink. The new hook keeps sink-specific wire logic out of the central serializer while retaining the fallback for unmigrated sinks. Add focused coverage for child and sort-order encoding and verify that existing file sinks continue to use the compatibility path. Refs apache#23498
FileSinkConfig is owned by datafusion-datasource, but its protobuf conversion lived in the central proto crate. Co-locating it lets sink implementations reuse the wire logic without depending on datafusion-proto. Keep existing TryFromProto implementations as compatibility delegates and verify both APIs produce the same protobuf data. CLOSES apache#23498
CsvSink serialization still depended on central downcasts in datafusion-proto. Moving encode and decode ownership into the CSV sink exercises the DataSink hook and keeps format-specific wire logic with the concrete type. Retain the old decode helper as a deprecated compatibility shim. Refs apache#23519
JsonSink serialization still depended on central downcasts in datafusion-proto. Moving encode and decode ownership into the JSON sink exercises the DataSink hook and keeps format-specific wire logic with the concrete type. Retain the old decode helper as a deprecated compatibility shim. Refs apache#23519
ParquetSink serialization still depended on the final concrete sink downcast in datafusion-proto. Moving encode and decode ownership into the Parquet sink completes the DataSink migration and keeps format-specific wire logic with the concrete type. Remove the now-unused central dispatch path while retaining its public helpers as deprecated compatibility shims. Refs apache#23519 Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
Phoenix500526
marked this pull request as draft
July 21, 2026 23:59
|
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 #23781 +/- ##
==========================================
- Coverage 80.71% 80.68% -0.04%
==========================================
Files 1089 1090 +1
Lines 368750 368965 +215
Branches 368750 368965 +215
==========================================
+ Hits 297631 297692 +61
- Misses 53375 53517 +142
- Partials 17744 17756 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This is a stacked PR based on #23752. Only the commits on top of #23752 are part of this review.
Which issue does this PR close?
Rationale for this change
#23752 adds the
DataSink::try_to_protohook and moves the sharedFileSinkConfigprotobuf conversion intodatafusion-datasource.This PR uses that foundation to move CSV, JSON, and Parquet sink
serialization out of the central
datafusion-protodowncast chain.Each concrete sink now owns its format-specific protobuf encoding and
decoding logic.
What changes are included in this PR?
DataSink::try_to_protoforCsvSink,JsonSink, andParquetSink.try_from_protomethods to reconstruct each sink'sDataSinkExec.DataSinkExecserialization dispatch aftermigrating its final built-in sink.
delegates.
the physical extension codec.
The migrations are split into one commit per sink.
Are these changes tested?
Yes. Existing sink round-trip tests cover the protobuf representation.
The following checks passed:
datafusion-protointegration tests.cargo check -p datafusion-proto --no-default-features.cargo fmt --all.cargo clippy --all-targets --all-features -- -D warnings.logic test files.
Are there any user-facing changes?
No functional or wire-format changes are intended.
The old compatibility helpers remain available but are deprecated.