Skip to content

Add Arrow IPC stream output (--format ipc) - #45

Merged
jonasdedden merged 2 commits into
mainfrom
feat/issue-12-ipc
Jul 22, 2026
Merged

jonasdedden merged 2 commits into
mainfrom
feat/issue-12-ipc

Conversation

@jonasdedden

Copy link
Copy Markdown
Owner

Adds --format ipc: lossless Arrow IPC streaming to stdout for the row-producing commands (cat, head, tail, take, sample) via StreamWriter at constant memory, composing arrs with DuckDB (read_arrow), pyarrow, Polars, and ADBC tools with zero fidelity loss. Refuses a terminal stdout, rejects the inapplicable value-rendering flags, and is rejected on metadata/summary commands. pyarrow + DuckDB interop verified by the reviewer.

Rebased onto current main over #13/#22/#14/#21 exactly as the reviewer pre-identified: two textual unions (dispatch IPC validation + show_progress call; README examples) and the two compiler-enforced E0004 unions — Some(Format::Ipc) rejection in the generic two-dataset diff (#13) and Blob/defensive Completions arms in command_rejecting_ipc (#22/#14) — plus post-cut initializer fields in tests/ipc.rs.

Post-rebase interaction check with #21: head --with-row-id --with-row-addr --format ipc decodes via arrow's StreamReader with _rowid/_rowaddr as trailing UInt64 columns — pseudo-columns flow through the IPC stream.

Gates: fmt/clippy clean, 337 tests / 0 failures.

Closes #12

🤖 Generated with Claude Code

jonasdedden and others added 2 commits July 22, 2026 12:11
Add `--format ipc` on the row-producing commands (cat/head/tail/take/
sample), writing the Arrow IPC streaming format to stdout via
`arrow::ipc::writer::StreamWriter`. The path bypasses value rendering
entirely — batches go straight from the scan to the writer — so output is
lossless and fully streaming at constant memory.

IPC slots into the existing `RowWriter` seam (start(schema) → write_batch →
finish), which is already batch-level, so command code is unchanged; the new
`IpcRowWriter` defers `StreamWriter` construction to `start`. Central
validation in `dispatch` (before any output): reject IPC on metadata/summary
commands, reject the inapplicable value-rendering flags rather than silently
ignore them, and refuse to write the binary stream to a terminal via a pure,
unit-tested guard predicate.

Round-trip, empty-stream, TTY-guard, flag-rejection, and command-rejection
tests; README + CHANGELOG.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The reviewer-predicted E0004 unions: the generic two-dataset diff (#13)
rejects --format ipc like its other non-jsonl formats, and
command_rejecting_ipc gains Blob (#22) plus a defensive Completions
(#14) arm. tests/ipc.rs initializers gain no_progress (#14),
Diff::other (#13), and Cat row_ids (#21).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jonasdedden
jonasdedden enabled auto-merge (squash) July 22, 2026 10:15
@jonasdedden
jonasdedden merged commit 11083ab into main Jul 22, 2026
4 checks passed
@jonasdedden
jonasdedden deleted the feat/issue-12-ipc branch July 22, 2026 10:16
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 IPC stream output (--format ipc)

1 participant