Skip to content

Conversation

@quinnj
Copy link
Member

@quinnj quinnj commented Jan 16, 2026

Summary

  • Fixes Arrow.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 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.

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

1 participant