QueryResult & QueryHandle
Collect results and manage async query lifecycle.
QueryResult
Returned by synchronous execute_local() calls. Contains a list of collected Arrow batches.
| Method | Returns | Description |
|---|---|---|
batches() -> list[RecordBatch] | list | Return the raw Arrow RecordBatch list. |
row_count() -> int | int | Total number of rows across all batches. |
pretty() -> str | str | Return a formatted ASCII table string. |
show() | None | Print the formatted table to stdout. |
to_arrow() -> Table | pyarrow.Table | Convert to a PyArrow Table. |
to_pandas() -> DataFrame | pandas.DataFrame | Convert to a pandas DataFrame (requires pandas). |
len() -> int | int | Same as row_count(); also works with len(result). |
QueryHandle
Returned by execute_remote() and submit_async(). Represents an in-flight asynchronous query.
| Method | Returns | Description |
|---|---|---|
query_id() -> str | str | Unique query identifier. |
status() -> str | str | Current query status: "Running", "Completed", "Failed", "Cancelled". |
is_done() -> bool | bool | True if the query has completed (any terminal state). |
progress() -> float | float | Estimated progress in [0.0, 1.0]. |
collect() -> QueryResult | QueryResult | Block until done and collect all results. |
cancel() | None | Request cancellation of the query. |
JobStatus
Returned by session.submit_stream_job() and session.jobs().
| Method | Returns | Description |
|---|---|---|
id() -> str | str | Job ID. |
name() -> str | str | Job name. |
state() -> str | str | Job state: "Running", "Completed", "Failed", etc. |