Skip to content

Commit 0fca9d7

Browse files
vuanhphungIsaac
andcommitted
docs(kernel): describe the kernel-rows path in the result-set module docstring
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
1 parent c23e033 commit 0fca9d7

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎src/databricks/sql/backend/kernel/result_set.py‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
``ExecutedAsyncStatement.await_result()``. No statement id; no
1010
cancel.
1111
12-
Both implement the same three methods this class actually calls:
13-
``arrow_schema() / fetch_next_batch() / close()``. ``KernelResultSet``
14-
takes either via the ``kernel_handle`` parameter and treats them
15-
uniformly — the connector's ``ResultSet`` contract doesn't need to
16-
distinguish them.
17-
18-
Buffer shape mirrors the prior ADBC POC's ``AdbcResultSet``: a FIFO
19-
of pyarrow ``RecordBatch``es, fed one batch at a time from the
12+
Both implement ``arrow_schema() / fetch_next_batch() / close()``.
13+
``KernelResultSet`` takes either via the ``kernel_handle`` parameter and
14+
treats them uniformly — the connector's ``ResultSet`` contract doesn't
15+
need to distinguish them. Newer kernels also have ``schema_key()`` and
16+
``fetch_all_rows()``: the schema key looks the cached description up
17+
without calling ``arrow_schema()``, and the first row fetch (unless an
18+
Arrow fetch came first) gets a small result's rows as Python values in
19+
one ``fetch_all_rows()`` call.
20+
21+
Otherwise the buffer mirrors the prior ADBC POC's ``AdbcResultSet``: a
22+
FIFO of pyarrow ``RecordBatch``es, fed one batch at a time from the
2023
kernel as the connector calls ``fetch*``. ``fetchmany(n)`` slices
2124
within a batch when ``n`` is smaller than the kernel's natural
2225
batch size; ``fetchall`` drains the whole stream.

0 commit comments

Comments
 (0)