fix(proto): preserve Parquet source and sink state - #25057
Conversation
|
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 #25057 +/- ##
==========================================
+ Coverage 81.97% 82.28% +0.31%
==========================================
Files 1137 1137
Lines 429901 430108 +207
Branches 429901 430108 +207
==========================================
+ Hits 352414 353928 +1514
+ Misses 56437 54759 -1678
- Partials 21050 21421 +371 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you @buraksenn |
…estructure # Conflicts: # datafusion/proto/tests/cases/plans/sinks.rs # docs/source/library-user-guide/upgrading/56.0.0.md
Head branch was pushed to by a user without write access
|
@buraksenn can you fix the clippy issue |
sorry missed this while fixing conflict |
There seems to be a conflict 😬 |
…estructure # Conflicts: # datafusion/datasource-parquet/src/source.rs
Which issue does this PR close?
Rationale for this change
Parquet source and sink protobuf hooks accessed fields individually and silently dropped source metadata prefetch hints and sink sorting-column metadata. This changed performance characteristics and omitted metadata from files written after a plan round trip.
What changes are included in this PR?
ParquetSource,ParquetSink, and their protobuf messages.ParquetSource::metadata_size_hintwith a checked integer conversion.ParquetSink::sorting_columns, including the distinction betweenNoneand an empty list.#24930 already preserves
reverse_row_groupsandsort_order_for_reorder; this PR builds on that behavior rather than duplicating it.The protobuf wire changes are additive and backward compatible.
What is the testing strategy for this PR?
Physical-plan round-trip coverage verifies:
None, zero, a normal value, andusize::MAX.None, an empty list, and populated lists.Both regression tests were ablation-checked and fail when their corresponding field is omitted from serialization.
Validated with:
cargo test -p datafusion-proto --test proto_integration --features json(262 passed)cargo clippy -p datafusion-datasource-parquet -p datafusion-proto --all-features --tests -- -D warningscargo fmt --all -- --check./ci/scripts/doc_prettier_check.sh --write --allow-dirtyAre there any user-facing changes?
Parquet scan metadata prefetch hints and sink sorting-column metadata now survive protobuf plan round trips. The protobuf wire additions are backward compatible.
Adding
metadata_size_hintto the generated publicParquetScanExecNodeRust struct andsorting_columnstoParquetSinkis a source-level API change for callers using exhaustive struct literals. Such callers must initialize the new fields (useNoneto retain previous behavior) or use..Default::default(). This migration is documented in the DataFusion 56.0.0 upgrade guide.