ProductDocsArchitectureBlogGitHubGitHubGet Started
Available

QueryResult & QueryHandle

Collect results and manage async query lifecycle.

QueryResult

Returned by synchronous execute_local() calls. Contains a list of collected Arrow batches.

MethodReturnsDescription
batches() -> list[RecordBatch]listReturn the raw Arrow RecordBatch list.
row_count() -> intintTotal number of rows across all batches.
pretty() -> strstrReturn a formatted ASCII table string.
show()NonePrint the formatted table to stdout.
to_arrow() -> Tablepyarrow.TableConvert to a PyArrow Table.
to_pandas() -> DataFramepandas.DataFrameConvert to a pandas DataFrame (requires pandas).
len() -> intintSame as row_count(); also works with len(result).

QueryHandle

Returned by execute_remote() and submit_async(). Represents an in-flight asynchronous query.

MethodReturnsDescription
query_id() -> strstrUnique query identifier.
status() -> strstrCurrent query status: "Running", "Completed", "Failed", "Cancelled".
is_done() -> boolboolTrue if the query has completed (any terminal state).
progress() -> floatfloatEstimated progress in [0.0, 1.0].
collect() -> QueryResultQueryResultBlock until done and collect all results.
cancel()NoneRequest cancellation of the query.

JobStatus

Returned by session.submit_stream_job() and session.jobs().

MethodReturnsDescription
id() -> strstrJob ID.
name() -> strstrJob name.
state() -> strstrJob state: "Running", "Completed", "Failed", etc.