Commit bb749d6
committed
[SEA-NodeJS] Sync execute via directResults (executeStatementDirect)
The default sync path (`runAsync: false`) now calls the kernel's additive
`Connection.executeStatementDirect` instead of `executeStatementCancellable`.
The kernel runs ExecuteStatement with a bounded server inline wait and returns
WITHOUT polling past it; the session feature-detects the arm via `awaitResult`:
a fast query comes back as a terminal `Statement` (result inline) → wrapped with
the operation backend's `statement` arm; a slow one as an `AsyncStatement` →
the `asyncStatement` arm.
Because the returned handle always corresponds to a server-owned statement:
- fire-and-forget CREATE/INSERT commits (server runs it inline in the POST);
- `close()` is a clean release, never a drive-to-terminal (no close-drives);
- a long query stays cancellable via `op.cancel()` (~150-300ms), Thrift parity;
- errors surface at `executeStatement`, matching Thrift / Python use_kernel.
Requires the kernel's additive directResults execute
(databricks/databricks-sql-kernel#140). `execute()` on the kernel is unchanged,
so Python `use_kernel` needs no change. Regenerated napi types add
`executeStatementDirect`.
Validated e2e (pecotesting): CREATE fire-and-forget commits, 100k read, error
at execute, mid-run cancel, close() cheap (~120ms) on an abandoned long query.
Unit: SEA suite 260 passing; eslint clean.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent f4d1675 commit bb749d6
3 files changed
Lines changed: 57 additions & 11 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 | + | |
198 | 211 | | |
199 | | - | |
| 212 | + | |
200 | 213 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 214 | | |
205 | 215 | | |
206 | 216 | | |
| |||
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