Description
In arrow-ipc/src/reader.rs, the skip_field function currently uses a wildcard (_) match arm to handle remaining DataType variants by skipping two buffers.
_ => {
self.skip_buffer();
self.skip_buffer();
}
While this works for current types, it is not robust. If new DataType variants are added in the future, they will be silently routed through this fallback, which may not match their actual buffer layout.
Problem
- The wildcard match hides assumptions about buffer layout.
- New or more complex types (e.g., previously ListView / LargeListView) could be incorrectly handled if they are not explicitly matched.
- This can lead to buffer misalignment and incorrect decoding without compile-time detection.
Proposed Change
Replace the wildcard arm with an explicit match over all remaining DataType variants that follow the same layout (null buffer + values buffer).
This ensures:
- All variants are handled explicitly
- Future additions to
DataType will trigger a compile-time error instead of silently falling back to incorrect behavior
cc @alamb
Description
In
arrow-ipc/src/reader.rs, theskip_fieldfunction currently uses a wildcard (_) match arm to handle remainingDataTypevariants by skipping two buffers.While this works for current types, it is not robust. If new
DataTypevariants are added in the future, they will be silently routed through this fallback, which may not match their actual buffer layout.Problem
Proposed Change
Replace the wildcard arm with an explicit match over all remaining
DataTypevariants that follow the same layout (null buffer + values buffer).This ensures:
DataTypewill trigger a compile-time error instead of silently falling back to incorrect behaviorcc @alamb