You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sea): address PR review comments + fix failing unit tests
Failing unit test (TS2737): ArrowResultConverter.test.ts used BigInt
literals (`123n`), which don't compile at the tsconfig ES2018 target the
unit-test job typechecks against. Replaced with `BigInt('123')` calls
(the BigInt function is available at ES2018; only the literal syntax is
gated).
Review comments:
- C1 (rich-status propagation untested): the kernel-statement fakes
returned null for all four rich-status accessors, so the propagation
through `op.status()` was never exercised with a real value.
Parameterized the fakes and added a sync-DML test asserting
numModifiedRows / displayMessage / diagnosticInfo / errorDetailsJson
all surface, plus an all-null SELECT case. (Verified live: the SEA
REST server delivers DML counts as a `num_affected_rows` result
column rather than on the status envelope, so the kernel accessor
returns null against current SEA warehouses by design; Thrift on the
same warehouse surfaces Int64(4) on status. The wiring is correct and
will surface values when a server populates the status field.)
- C2 (synthesizeThriftStatus rich fields untested): added tests for the
Int64 re-boxing of numModifiedRows (including 0 vs absent), the
null -> undefined mapping, and the string passthrough fields.
- C3 (header injection): customHeaders values/names were forwarded
verbatim; CR/LF/NUL enable HTTP header injection and the kernel only
rejects them at connect time with an opaque error. Added early
validation in buildSeaHttpOptions throwing a clear HiveDriverError
that names the offending header (validated before the reserved-name
drop). Verified live against pecotesting.
- C4 (dead conjunct): simplified `if (this.asyncStatement &&
!this.cancellableExecution)` to `if (this.asyncStatement)` — the
constructor already guarantees the handle kinds are mutually
exclusive.
- C5 (redundant FFI reads): memoized readRichStatusFields so a
re-status() of a terminal operation reuses the read instead of
re-hitting the four kernel accessors. Covered by the C1 read-count
assertion.
Co-authored-by: Isaac
0 commit comments