Repository navigation
feat(napi): TypedValue codec for positional params - #84
Closed
msrathore-db wants to merge 1 commit into
Closed
msrathore-db wants to merge 1 commit into
msrathore-db wants to merge 1 commit into
Conversation
Collaborator
|
P0 — Must fix GEOGRAPHY/GEOMETRY accepted in pyo3 but rejected in napi
P1 — Should fix No regression-pinning test for the exact "BINARY" substring
extract_decimal_precision_scale doesn't reject trailing garbage after )
c5_ten_type_matrix_round_trips test only has 9 entries
decode_positional_params_10_type_matrix doesn't assert order preservation
P2 — Minor
|
This was referenced May 31, 2026
Mirror pyo3/src/params.rs in the napi binding so the JS side can bind
positional parameters via Connection.executeStatement(sql, { positional_params }).
Each parameter is a { sql_type, value } pair — value is the string-encoded
literal or null for SQL NULL. The decoder parses through the same
validation surface pyo3 uses (DECIMAL precision/scale, non-finite
FLOAT/DOUBLE rejection, compound/BINARY rejection), so the two
language bindings stay aligned on what the kernel sees on the wire.
ExecuteOptions is exposed as a JS-visible object so future
statement-level knobs (named params, conf overlay, result format)
can land non-breakingly.
Tests cover the 10-type C5 matrix (INT, BIGINT, FLOAT, DOUBLE,
STRING, BOOLEAN, DATE, TIMESTAMP, DECIMAL, BINARY-rejected) plus
the eager-failure + null-value contracts at the helper level.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
force-pushed
the
msrathore/krn-napi-typedvalue-codec
branch
from
June 1, 2026 01:11
16b1bec to
88e5e97
Compare
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TypedValuecodec mirroringpyo3/src/params.rs, so the Node driver can bind positional parameters viaConnection.executeStatement(sql, { positional_params }).ExecuteOptionsnapi object carryingpositional_params: Option<Vec<TypedValueInput>>— each entry is a{ sqlType, value }pair. Future per-statement knobs (named params, conf overlay, result format) can land non-breakingly inside this object.C5 cluster context
This is PR-A of the C5 (params-basic-binding) chain:
TypedValuecodec +ExecuteOptions.positional_params.executeStatement(sql, { ordinalParameters })to this codec — independent open againstdatabricks/databricks-sql-nodejs.BackendComparator.forEachBackendagainstdatabricks/databricks-driver-test.Each PR is independent and can be reviewed in parallel — they only depend on each other for the end-to-end live-warehouse run.
Decisions / scope
DBSQLParameter.toSparkParameter()shape on the Node side and the pyo3 binding'sbind_param(sql_type: str, value: Optional[str])shape.Quality gates
Downstream fixes / reviewer note
main; the actual SEA execution wiring for positional params lands downstream in databricks-sql-nodejs#403.Test plan
This pull request and its description were written by Isaac.