Skip to content

feat(napi): expose intervalsAsString + complexTypesAsJson on openSession - #96

Closed
msrathore-db wants to merge 1 commit into
msrathore/krn-napi-oauthfrom
msrathore/krn-napi-result-config
Closed

msrathore-db wants to merge 1 commit into
msrathore/krn-napi-oauthfrom
msrathore/krn-napi-result-config

Conversation

@msrathore-db

@msrathore-db msrathore-db commented May 31, 2026 •

Copy link
Copy Markdown
Collaborator

What

Surface the kernel's ResultConfig.intervals_as_string and complex_types_as_json knobs on the napi ConnectionOptions, threaded onto SessionBuilder via builder.result(ResultConfig) — mirroring the pyo3 Session.__new__ surface. Omitted ⇒ kernel default (native Arrow month_interval/duration[us] and native nested types).

Why

The NodeJS Thrift driver surfaces INTERVAL columns as strings, while the kernel defaults to native Arrow interval/duration types. Running the node comparator thrift-vs-SEA, interval columns were the only STATEMENT_SELECT divergence (Thrift type 7 STRING vs kernel type 21 INTERVAL). Exposing intervals_as_string lets the SEA NodeJS driver set it true and become a byte-compatible drop-in — confirmed: interval columns then match Thrift in both type code and value. complex_types_as_json is exposed alongside for completeness (the SEA driver keeps the native-Arrow default, which already decodes identically to Thrift).

Verified identical behaviour in the Python kernel binding: Session(..., intervals_as_string=True) → Arrow string; default → month_interval/duration[us].

Scope

Stacked on #95. Only napi/src/database.rs (the two ConnectionOptions fields + builder.result(...) wiring + test-fixture fields). No param/codec changes — positional params are #84.

Tests

cargo build / fmt / clippy -D warnings clean; 41 napi tests pass.

This pull request and its description were written by Isaac.

Downstream fixes / reviewer note

Surface the kernel's ResultConfig.intervals_as_string and
complex_types_as_json knobs on the napi ConnectionOptions, threaded onto
the SessionBuilder via `builder.result(ResultConfig)` (mirrors the pyo3
Session.__new__ surface). Omitted ⇒ kernel default (native Arrow
month_interval / duration[us] and native nested types).

Motivation: the NodeJS Thrift driver surfaces INTERVAL columns as strings,
so the SEA driver needs intervals_as_string=true for byte-compatible
result parity (verified via the node comparator — interval columns then
match Thrift in both type code and value). complex_types_as_json is
exposed alongside for completeness; the SEA driver leaves it at the
native-Arrow default (which already decodes identically to Thrift).

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@msrathore-db

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #101, which is now the main-based kernel SEA parity mega PR for agent review. The branch is preserved and this can be reopened if we decide to return to smaller stacked reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant