Commit 63a8761
committed
[SEA-NodeJS] Sync execute via directResults: fix CREATE, drop close-drives, keep mid-run cancel
The default sync path (`runAsync: false`) now calls the kernel's directResults
execute (`Connection.executeStatementDirect`) instead of the cancellable-execute
path. The kernel runs ExecuteStatement with a bounded server inline wait and
returns WITHOUT polling past it: a fast query comes back as a terminal
`Statement` (result inline), a slow one as an `AsyncStatement` (a poll/cancel
handle). The session feature-detects the arm via `awaitResult` and wraps it with
the operation backend's existing `statement` / `asyncStatement` arms.
Because the returned handle always corresponds to a server-owned statement:
- fire-and-forget `CREATE`/`INSERT` (execute then close, no fetch) COMMITS —
the server runs it inline during the POST (fixes the prior lazy-execute
"CREATE didn't run" bug);
- `close()` is a clean release (DELETE), never a drive-to-terminal — the
eager-handle + close-drives workaround is gone entirely;
- a long query is cancellable via `op.cancel()` once the handle is held
(~150-300ms), at parity with the Thrift backend;
- errors surface at `executeStatement` (not silently at close), matching
Thrift and Python use_kernel.
Requires the kernel directResults execute (databricks/databricks-sql-kernel#136).
The regenerated napi router types add `executeStatementDirect`; the fallback
package names stay on the driver's canonical `@databricks/sql-kernel-*`.
Validated e2e (pecotesting): CREATE fire-and-forget commits, dependent ordering,
100k read, error-at-execute, mid-run cancel, and close() cheap (~120ms) on an
abandoned long query. Unit: SEA suite 247 passing; eslint clean.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 4b9e16e commit 63a8761
3 files changed
Lines changed: 63 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
190 | 197 | | |
191 | | - | |
| 198 | + | |
192 | 199 | | |
193 | | - | |
194 | | - | |
| 200 | + | |
| 201 | + | |
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
198 | 214 | | |
199 | | - | |
| 215 | + | |
200 | 216 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 217 | | |
205 | 218 | | |
206 | 219 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
237 | 257 | | |
238 | 258 | | |
239 | 259 | | |
| |||
0 commit comments