Skip to content

Replace wildcard match in skip_field with explicit DataType handling #9821

@pchintar

Description

@pchintar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crate

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions