Commit 8974e7b
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 a SINGLE
`ExecutedAsyncStatement` -- seeded with the inline result when the query finished
within the server inline wait (fast path, zero extra round-trips), or a
poll/cancel handle when still running -- instead of always blocking to terminal.
`KernelDatabricksClient.execute_command` now drives ONE uniform path (no
`hasattr(await_result)` arm to feature-detect): register the handle (so
`cursor.cancel()` / `close()` reach it), then `await_result()` to drive it to a
ready result set -- 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-handle return. Mid-run
cancel still works via the `_sync_cancellers` canceller registered before
execute.
Tested e2e against live warehouses (auto-closing and non-auto-closing): SELECT 1,
range(N), and CREATE+count all succeed on both. The kernel maps an auto-closed
`CLOSED` statement to `Succeeded`, so the connector sees a uniform success
regardless of warehouse auto-close behaviour.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 85f8ba3 commit 8974e7b
1 file changed
Lines changed: 19 additions & 24 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 | + | |
488 | 492 | | |
| 493 | + | |
| 494 | + | |
489 | 495 | | |
490 | 496 | | |
491 | 497 | | |
| |||
501 | 507 | | |
502 | 508 | | |
503 | 509 | | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | 510 | | |
516 | 511 | | |
517 | 512 | | |
| |||
0 commit comments