fix(proto): preserve Arrow IPC stream format - #24224
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 #24224 +/- ##
==========================================
- Coverage 80.99% 80.96% -0.03%
==========================================
Files 1106 1106
Lines 383158 383315 +157
Branches 383158 383315 +157
==========================================
+ Hits 310331 310367 +36
- Misses 54513 54626 +113
- Partials 18314 18322 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| enum ArrowIpcFormat { | ||
| // Unset in payloads encoded before this field existed; decoded as the | ||
| // IPC file format for backward compatibility. | ||
| ARROW_IPC_FORMAT_UNSPECIFIED = 0; | ||
| // Arrow IPC file format (with footer, supports range-based parallel reading) | ||
| ARROW_IPC_FORMAT_FILE = 1; | ||
| // Arrow IPC stream format (without footer, sequential reading only) | ||
| ARROW_IPC_FORMAT_STREAM = 2; | ||
| } |
There was a problem hiding this comment.
if ARROW_IPC_FORMAT_UNSPECIFIED exist for the sake of backwards compatiability cant the default value be set to ARROW_IPC_FORMAT_FILE. this way we dont need a third variant especially since it will be interpreted as ARROW_IPC_FORMAT_FILE anyway?
Which issue does this PR close?
Rationale for this change
ArrowSourcedistinguishes between Arrow IPC file and stream formats, but this format was not serialized. As a result, a stream scan round-tripped through protobuf as a file scan, selecting the wrong opener and potentially allowing unsupported range-based repartitioning.What changes are included in this PR?
ArrowIpcFormatdiscriminator toArrowScanExecNode.ArrowSourceIPC format.Are these changes tested?
Yes:
cargo test -p datafusion-proto --test proto_integration roundtrip_arrowcargo test -p datafusion-proto --test proto_integration arrow_scan_without_format_field_decodes_as_file_formatcargo fmt --alldatafusion-datasource-arrowanddatafusion-protoAre there any user-facing changes?
Arrow IPC stream scans now preserve their format across protobuf round trips.
The binary protobuf change is additive. Older payloads continue to decode as file format. Stream preservation requires both producer and consumer to include this change because older versions do not carry or read the discriminator. The generated Rust
ArrowScanExecNodestruct gains aformatfield.