Commit de04e19
authored
[SEA-NodeJS] (3/3) INTERVAL type parity + operation-lifecycle depth (#411)
* feat(sea): INTERVAL type parity + operation-lifecycle depth [3/3]
Third of three stacked PRs (base: [2/3] execution + results). Completes the
SEA foundation:
- ArrowResultConverter: INTERVAL parity. Formats Arrow Interval[YearMonth] /
Interval[DayTime] and Duration (rewritten to Int64 by SeaArrowIpcDurationFix)
into the canonical Thrift strings ("Y-M" / "D HH:mm:ss.fffffffff"), byte-
identical to the Thrift path. Threads the Arrow field through convertArrowTypes
so the duration-unit metadata is available at value-conversion time.
- Exhaustive operation-lifecycle coverage: seaCancel / seaClose / seaFinished
idempotency, flag-set-before-await ordering (cancel-mid-fetch), kernel-error
mapping, and the neutral OperationStatus callback shape.
- SeaIntervalParity tests build real Arrow IPC batches via flatbuffers and
assert the formatted strings.
With this, SEA reaches M0 parity with Thrift (connect/auth → execute →
fetch → operation lifecycle → INTERVAL types). Replaces the single 8/8 PR #383.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
* fix(sea): address #411 review — exhaustive interval switch, docs, coverage
Validated every interval edge case (null, multi-row, negative sub-year,
sibling-survives) against a live pecotesting warehouse first — all byte-identical
to Thrift. The findings were layering/dead-code/coverage, not runtime bugs.
- F1: corrected the DURATION_UNIT_METADATA_KEY doc — the interval/duration
branches are SEA-gated by construction (Thrift maps INTERVAL → ArrowString and
never reaches them), NOT "reused by thrift" as the old comment claimed.
- F3/F6/F10: formatArrowInterval now handles YEAR_MONTH only (typed `Interval` +
`IntervalUnit.YEAR_MONTH`, no magic `=== 0`) and THROWS on any other unit. The
old non-exhaustive default silently misread MONTH_DAY_NANO/undefined as
[days,ms]; and the native Interval[DayTime] branch was dead+broken (the kernel
emits DAY-TIME as Duration, handled separately) — removed it.
- F2: exported the metadata key + added a test pinning it equal to the SEA-side
declaration (guards against a silent rename drift).
- F8: dropped the dead `_unit` param from formatDayTimeFromTotal.
- F9: removed the dead duration check in the BigNum branch (rewritten Int64s
arrive as raw bigint) and fixed the false "Int32Array instanceof Uint8Array"
comment.
- F7: added a YEAR-MONTH sub-year-negative unit test (-1 month → "-0-1").
- F4: added live e2e for null INTERVAL → null and multi-row batches.
- F5: e2e before() now probes getSeaNative() and skips (not errors) when the
binding is absent; dropped the flaky wall-clock latency assertions (assert
behavior — cancel resolved, callback fired once).
Deferred (low/informational, noted): F11 (consolidate test makeContext helpers),
F12 (tighten instanceOf assertions), F13 (per-operation interval-representation
breadcrumb — a per-value log would be spam).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
* fix(sea): address #411 review — fail-loud duration unit, interval test gaps
Addresses the P2 review comment on #411 (the interval/duration layer) and
cascades the #410 fixes underneath (this branch was rebased onto the
updated #410 tip). Validated against a live warehouse (interval-duration
+ interval-edge e2e) and unit tests.
- ArrowResultConverter.toNanoseconds: throw on an unrecognized Arrow
duration unit instead of silently defaulting to NANOSECOND. The four
units are exactly what SeaArrowIpcDurationFix stamps, so an unknown unit
means the two sides drifted — fail loud, matching formatArrowInterval.
- SeaIntervalParity tests: add DAY-TIME via Duration(MILLISECOND) and
Duration(SECOND) (only MICROSECOND/NANOSECOND were exercised), and a
test asserting the converter throws (HiveDriverError) on a native
non-YEAR_MONTH Arrow Interval rather than misreading it.
- interval-duration-e2e: flip the stale "raw Int64 on this layer" assertion
to expect the formatted thrift string "1 02:03:04.000000000". That test
was written on #410 (pre-formatter) and explicitly noted "#411 flips this
to the formatted string" — now that #411's formatter is wired, the value
is the byte-identical thrift DAY-TIME string.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
---------
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 4ba2175 commit de04e19
6 files changed
Lines changed: 1445 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
26 | 172 | | |
27 | 173 | | |
28 | 174 | | |
| |||
147 | 293 | | |
148 | 294 | | |
149 | 295 | | |
150 | | - | |
| 296 | + | |
151 | 297 | | |
152 | 298 | | |
153 | 299 | | |
154 | 300 | | |
155 | 301 | | |
156 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
157 | 308 | | |
158 | 309 | | |
159 | 310 | | |
160 | 311 | | |
161 | 312 | | |
162 | | - | |
163 | | - | |
| 313 | + | |
| 314 | + | |
164 | 315 | | |
165 | 316 | | |
166 | 317 | | |
167 | 318 | | |
168 | 319 | | |
169 | 320 | | |
170 | | - | |
171 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
172 | 328 | | |
173 | 329 | | |
174 | 330 | | |
175 | 331 | | |
176 | 332 | | |
177 | 333 | | |
178 | | - | |
| 334 | + | |
179 | 335 | | |
180 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
181 | 342 | | |
182 | 343 | | |
183 | 344 | | |
| |||
186 | 347 | | |
187 | 348 | | |
188 | 349 | | |
189 | | - | |
190 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
191 | 354 | | |
192 | 355 | | |
193 | 356 | | |
194 | 357 | | |
195 | 358 | | |
196 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
197 | 372 | | |
198 | 373 | | |
199 | 374 | | |
200 | 375 | | |
201 | 376 | | |
202 | 377 | | |
203 | 378 | | |
| 379 | + | |
| 380 | + | |
204 | 381 | | |
205 | 382 | | |
206 | 383 | | |
207 | | - | |
| 384 | + | |
208 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
209 | 390 | | |
210 | 391 | | |
211 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
212 | 403 | | |
213 | | - | |
| 404 | + | |
214 | 405 | | |
215 | 406 | | |
216 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
0 commit comments