Skip to content

fix(ipc): replace wildcard in skip_field with explicit DataType handling - #9822

Merged
alamb merged 1 commit into
apache:mainfrom
pchintar:ipc-explicit-skip-field
Apr 25, 2026
Merged

fix(ipc): replace wildcard in skip_field with explicit DataType handling#9822
alamb merged 1 commit into
apache:mainfrom
pchintar:ipc-explicit-skip-field

Conversation

@pchintar

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

skip_field currently uses a wildcard match (_) to skip remaining DataType variants by assuming a two-buffer layout. This is not robust, as new variants may have different buffer layouts, leading to incorrect skipping and buffer misalignment.

Replacing the wildcard with explicit handling ensures the correct number of buffers are skipped and avoids silent errors for future types.

What changes are included in this PR?

  • Removed the wildcard (_) match arm in skip_field

  • Added explicit handling for all remaining fixed-width and boolean DataType variants

  • Each of these types now explicitly skips:

    • null buffer
    • values buffer

File updated:

  • arrow-ipc/src/reader.rs

Are these changes tested?

Yes.

  • Added test: test_projection_skip_fixed_width_types in arrow-ipc/src/reader.rs

  • The test iterates over all fixed-width and boolean DataType variants covered by this change

  • For each type:

    • writes a batch with [skipped_column(type), values_column(Int32)]
    • reads only the second column (skipping the first)
    • verifies whether the returned column exactly matches the original Int32 values
  • This directly validates that skipping each of these types consumes the correct number of buffers

  • Also, all existing arrow-ipc tests pass (cargo test -p arrow-ipc --lib)

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Apr 25, 2026
@pchintar

Copy link
Copy Markdown
Contributor Author

cc @alamb

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great -- thank you @pchintar

@alamb
alamb merged commit 4fa8d2f into apache:main Apr 25, 2026
26 checks passed
@pchintar

Copy link
Copy Markdown
Contributor Author

thank you @alamb

@alamb

alamb commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Thank you!

Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Jun 2, 2026
…ing (apache#9822)

# Which issue does this PR close?

- Closes apache#9821 .

# Rationale for this change

`skip_field` currently uses a wildcard match (`_`) to skip remaining
`DataType` variants by assuming a two-buffer layout. This is not robust,
as new variants may have different buffer layouts, leading to incorrect
skipping and buffer misalignment.

Replacing the wildcard with explicit handling ensures the correct number
of buffers are skipped and avoids silent errors for future types.

# What changes are included in this PR?

* Removed the wildcard (`_`) match arm in `skip_field`
* Added explicit handling for all remaining fixed-width and boolean
`DataType` variants
* Each of these types now explicitly skips:

  * null buffer
  * values buffer

File updated:

* `arrow-ipc/src/reader.rs`

# Are these changes tested?

Yes.

* Added test: `test_projection_skip_fixed_width_types` in
`arrow-ipc/src/reader.rs`

* The test iterates over all fixed-width and boolean `DataType` variants
covered by this change

* For each type:

  * writes a batch with `[skipped_column(type), values_column(Int32)]`
  * reads only the second column (skipping the first)
* verifies whether the returned column exactly matches the original
`Int32` values

* This directly validates that skipping each of these types consumes the
correct number of buffers

* Also, all existing `arrow-ipc` tests pass (`cargo test -p arrow-ipc
--lib`)

# Are there any user-facing changes?

No.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace wildcard match in skip_field with explicit DataType handling

2 participants