Commit acecd76
committed
feat(kernel): consume the folded directResults execute()
The kernel's `Statement.execute()` is now the directResults call
(databricks/databricks-sql-kernel#136): it returns either a terminal
`ExecutedStatement` (the query finished within the server inline wait) or a
still-running `ExecutedAsyncStatement`, instead of always blocking to terminal.
`KernelDatabricksClient.execute_command` now feature-detects the arm (via
`await_result`, present only on the async handle):
- terminal -> build the result set from the `ExecutedStatement` as before;
- still-running -> register the handle (so `cursor.cancel()` / `close()` reach
it), then `await_result()` to drive it to terminal — preserving execute()'s
blocking contract.
`cursor.execute()` behaviour is unchanged for callers (still blocks to a ready
result set); this just adapts to the kernel's new single result-or-handle
return. Mid-run cancel still works via the `_sync_cancellers` canceller
registered before execute.
Tested e2e against a live warehouse: CREATE/INSERT commit, 100k read, error
surfaces at execute, mid-run cancel (~130ms). Latency vs Thrift: SELECT 1
~parity, range(100000) ~parity.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 85f8ba3 commit acecd76
1 file changed
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
488 | 502 | | |
489 | 503 | | |
490 | 504 | | |
| |||
0 commit comments