feat(query): fetch results as Arrow IPC instead of JSON#103
Merged
Conversation
Switch the async query path and poll command from JSON to Arrow IPC (application/vnd.apache.arrow.stream) for result fetching. Arrow is ~39% smaller on the wire and ~150 ms faster on large result sets. - Add `get_bytes()` to ApiClient for binary HTTP responses - Add Arrow decoding: `arrow_cell`, `arrow_ipc_to_query_response`, `fetch_arrow_result` in query.rs - Inline async polling (500 ms interval with spinner) so callers never need to re-run the command for slow queries - `poll` subcommand updated to use Arrow fetch The sync fast-path (200 from /query) remains JSON since the server returns the result inline and does not support Arrow there. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Route get_bytes through send_debug_bytes so Arrow requests appear in --debug output (was bypassing debug logging entirely) - Replace unwrap_or_default() with resp.bytes()? to propagate body read errors instead of silently returning empty bytes - Remove dead req.build() error arm; send_debug_bytes handles it - Change execution_time_ms to Option<u64>; async Arrow results show "—" in the table footer instead of a misleading "0 ms" - Add 5-minute polling timeout to the async execute loop with a hint to re-check via `hotdata query status <run_id>` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the `_ => continue` catch-all in the async polling loop with explicit known in-flight states (`running | queued | pending`) and an unknown-status arm that clears the spinner, prints the unexpected status, and exits with code 2 — matching the behaviour of `poll()`. This prevents infinite loops on terminal statuses like `cancelled` or `timed_out` that the server may add in the future. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename QueryRunResponse.error -> error_message to match the actual server field name; previously failed async queries always printed "query failed: unknown error" instead of the real message - Make fetch_arrow_result pub(crate) and use it in results::get so that `hotdata results get <id>` fetches Arrow IPC like the rest of the query path, rather than falling back to JSON Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
skills list - Add List variant to SkillCommands as an alias for status databases show <id> - Add Show subcommand to DatabasesCommands; dispatches to databases::get() - Bare positional (hotdata databases <id>) preserved for backward compat databases tables <db_id> - Make Tables subcommand optional; bare positional db_id triggers tables_list - hotdata databases tables <id> now lists tables without requiring `list` subcommand - hotdata databases tables list --database <id> still works (backward compat) - hotdata databases tables with no args prints help Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pollsubcommand from JSON to Arrow IPC (application/vnd.apache.arrow.stream) for result fetchinghotdata query statusinvocationChanges
src/api.rs: Addedget_bytes(path, accept)for binary HTTP responses with a customAcceptheadersrc/query.rs: Addedarrow_cell,arrow_ipc_to_query_response,fetch_arrow_resultfor Arrow IPC decoding; async 202 path now polls inline;pollsubcommand uses Arrow fetchCargo.toml: Addedarrow = { version = "54", default-features = false, features = ["ipc"] }Notes
/query) remains JSON since the server returns the result inline and does not support an Arrow response thereArrayFormatterfor string renderingTest plan
SELECT COUNT(*)against managed database returns correct row count🤖 Generated with Claude Code