Skip to content

fix(arrow/ipc): return errors for malformed file record batches - #1062

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/ipc-file-record-errors
Open

fix(arrow/ipc): return errors for malformed file record batches#1062
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/ipc-file-record-errors

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

IPC stream reads convert record-loading panics from malformed messages into errors. FileReader.RecordBatchAt used the same loader without that boundary, so malformed record metadata could panic through an API that returns an error.

What changes are included in this PR?

Add an error-returning boundary around file record construction using the same recovered-error formatting as the stream reader. The explicit record-index bounds panic remains unchanged.

Are these changes tested?

Yes. A regression test supplies malformed metadata and verifies an error with no record.

go test ./arrow/ipc -run TestLoadRecordBatchReturnsMalformedMetadataErrors

Are there any user-facing changes?

Corrupt IPC file batches now return an error instead of panicking.

@fallintoplace
fallintoplace requested a review from zeroshade as a code owner July 29, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant