Commit 8bffb1e
committed
[SEA-NodeJS] Sync execute via directResults: fix CREATE, drop close-drives, keep mid-run cancel
The default sync path now calls the kernel's folded directResults `execute()`
(`Connection.executeStatement`, which returns a terminal `Statement` for a fast
query or an `AsyncStatement` for a still-running one). 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` 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;
- a long query is cancellable via `op.cancel()` once the handle is held
(~80-300ms), at parity with the Thrift backend;
- errors surface at `executeStatement`, matching Thrift / Python use_kernel.
Requires the kernel folded directResults execute
(databricks/databricks-sql-kernel#136). Regenerated napi router types
(`executeStatement` now returns `Statement | AsyncStatement`); 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, close() cheap 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 8bffb1e
3 files changed
Lines changed: 58 additions & 36 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 | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
232 | 238 | | |
233 | | - | |
234 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
235 | 244 | | |
236 | 245 | | |
237 | 246 | | |
| |||
0 commit comments