Skip to content

Fix non-seekable I/O support for Arrow.Stream - #584

Open
quinnj wants to merge 1 commit into
mainfrom
fix-580-non-seekable-io
Open

Fix non-seekable I/O support for Arrow.Stream#584
quinnj wants to merge 1 commit into
mainfrom
fix-580-non-seekable-io

Conversation

@quinnj

Copy link
Copy Markdown
Member

Summary

  • FixesArrow.Stream not working with non-seekable I/O e.g. FIFOs and sockets #580 - Arrow.Stream fails when reading from non-seekable I/O (FIFOs, pipes, sockets)
  • Modified tobytes(io::IOStream) to detect non-seekable streams and fall back to Base.read() instead of Mmap.mmap()
  • Modified Base.write(io::IO, msg::Message, ...) to handle non-seekable outputs by skipping block position tracking (only needed for file format footer)

Test plan

  • All existing tests pass (66,042 passed)
  • Pipe-based read works: open(\cat file.arrow`) do io; Arrow.Table(io); end`
  • Streaming write through pipe works
  • Regular file I/O unchanged (still uses mmap when possible)

🤖 Generated with Claude Code

When reading Arrow data from non-seekable streams (FIFOs, pipes, sockets),
`Arrow.Stream`/`Arrow.Table` would fail because `Mmap.mmap()` doesn't work
on these stream types.
Changes:
- Modified `tobytes(io::IOStream)` to detect non-seekable streams and fall
back to `Base.read(io)` instead of `Mmap.mmap(io)`
- Modified `Base.write(io::IO, msg::Message, ...)` to handle non-seekable
outputs by wrapping `position(io)` in try-catch and skipping block
tracking for non-seekable streams (only needed for file format footer)
This enables Arrow data to be read from process pipes, FIFOs, and other
non-seekable I/O sources.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for freeto 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.

Arrow.Stream not working with non-seekable I/O e.g. FIFOs and sockets

1 participant

@quinnj