Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- feat(query): add `QueryApi.query_arrow`, which returns a query's rows as Arrow in one call, with the rollup outcome and other response-header values

## [0.14.0] - 2026-11-19

### Changed
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,26 @@ with ApiClient(Configuration(api_key="...", workspace_id="...")) as client:

Both methods accept `offset` and `limit` for pagination. They raise `hotdata.arrow.ResultNotReadyError` if the result is still pending or processing — poll `results.get_result(result_id, database_id)` until `status == "ready"` first.

### Arrow from the query call

`QueryApi.query_arrow` runs a query and returns the rows as Arrow in one request, without fetching the stored result afterwards. The values the JSON response would carry come back on the result:

```python
from hotdata import ApiClient, Configuration, QueryApi, QueryRequest

with ApiClient(Configuration(api_key="...", workspace_id="...")) as client:
out = QueryApi(client).query_arrow(
QueryRequest(sql="SELECT toStartOfHour(ts) AS h, count() FROM events GROUP BY h",
dialect="clickhouse"),
x_database_id="your_database_id",
)
out.table # pyarrow.Table, with the server's column types
out.rollup # RollupUsage.USED / NOT_MATCHED / NOT_READY / UNAVAILABLE, or None
out.query_run_id, out.result_id, out.total_row_count, out.execution_time_ms, out.warning
```

HTTP 429 is retried as in `query`. A result too large to send inline is read from the Results API instead (`out.followed` is `True`), up to `max_auto_rows`; pass `auto_follow=False` to get a `ResultNotInlineError` carrying the `result_id` and stream it yourself.

## File uploads

`hotdata.uploads.UploadsApi` (also the default `hotdata.UploadsApi`) adds
Expand Down
Loading