Skip to content

feat(sea): wire rowLimit + statementConf + TIMESTAMP_NTZ/LTZ params#408

Open
msrathore-db wants to merge 3 commits into
msrathore/sea-tls-connectivityfrom
msrathore/sea-statement-options-params
Open

feat(sea): wire rowLimit + statementConf + TIMESTAMP_NTZ/LTZ params#408
msrathore-db wants to merge 3 commits into
msrathore/sea-tls-connectivityfrom
msrathore/sea-statement-options-params

Conversation

@msrathore-db
Copy link
Copy Markdown
Contributor

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

What

Three statement-option / param-type additions where the kernel + napi binding were already complete but the node SEA layer never exposed them. (Audit "Group A"; the fourth Group-A item, queryTags, was a dropped pre-existing option and is fixed upstream in #403.)

Addition Before After
rowLimit no SEA way to cap rows server-side new ExecuteStatementOptions.rowLimit → napi rowLimit (SEA row_limit)
statementConf no per-statement conf overlay new ExecuteStatementOptions.statementConf → napi statementConf (Thrift confOverlay equivalent)
TIMESTAMP_NTZ / LTZ params every Date coerced to TIMESTAMP DBSQLParameterType.TIMESTAMP_NTZ / TIMESTAMP_LTZ selectable

Why these were "free"

The kernel StatementSpec (row_limit, statement_conf, NTZ/LTZ TypedValue arms) and napi ExecuteOptions already exposed everything; the only missing piece was the node ExecuteStatementOptions surface + threading. No kernel/napi change.

Notes

  • statementConf generalises the existing query_tags serialisation (wired upstream in feat(sea): Thrift-parity — params, intervals, getInfo, SQL-error class, input validation + queryTags #403): a caller-supplied statementConf and queryTags merge into one conf map.
  • rowLimit is SEA-only (the Thrift backend has no execute-time server cap); maxRows remains the client-side per-fetch chunk size on both backends.
  • TIMESTAMP_NTZ/LTZ: toSparkParameter already honours an explicit type and SeaPositionalParams passes the SQL type verbatim to the kernel codec — so only the enum values were needed.

Testing

240 SEA unit tests pass (rowLimit/statementConf forwarding, statementConf+queryTags merge, NTZ/LTZ param mapping). Verified live against pecotesting earlier (rowLimit:7 caps a range(0,100) result to 7 rows; NTZ param round-trips).

Stacking

Stacked on #407#406#403#404.

This pull request and its description were written by Isaac.

Downstream fixes / reviewer note

  • 2026-06-01 review-fix cascade: final tip carries the [SEA-NodeJS] (7/8) Operation lifecycle — cancel / close / finished + INTERVAL parity + napi relocation #384 operation fixes: declared flatbuffers, one-pass IPC duration rewrite, cancel/close local-state rollback on native RPC failure, closed fetch → OperationStateError(Closed), and Arrow duration rewriter cleanup.
  • 2026-06-01 review-fix cascade: final tip also rejects unsupported per-statement useCloudFetch rather than silently ignoring it, and uses native sessionId/statementId for session/operation ids where available.

Three statement-option / param-type additions where the kernel + napi were
already ready but the node SEA layer didn't expose them:

- rowLimit: new `ExecuteStatementOptions.rowLimit` → napi `rowLimit`
  (SEA `row_limit`). SEA-only server-side cap; Thrift has no execute-time cap.
- statementConf: new `ExecuteStatementOptions.statementConf` → napi
  `statementConf` (SEA `statement_conf`), the Thrift `confOverlay` equivalent.
  Generalises the existing query_tags serialisation so a caller-supplied
  statementConf and queryTags merge into one conf map (queryTags already
  forwarded upstream).
- TIMESTAMP_NTZ / TIMESTAMP_LTZ: added to `DBSQLParameterType` so callers can
  bind timezone-explicit timestamp params. `toSparkParameter` already honours
  an explicit type and `SeaPositionalParams` passes the SQL type verbatim to
  the kernel codec (which has the NTZ/LTZ arms).

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@github-actions
Copy link
Copy Markdown

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

The cascade commit that surfaced `statementId` on `SeaNativeStatement` and
`sessionId` on `SeaNativeConnection` (matching the kernel napi binding's
new getters) didn't update the blocking test fakes, breaking compilation.
Add the readonly fields to FakeNativeStatement / FakeNativeConnection
(execution.test.ts) and FakeNativeStatement / FakeMetadataConnection
(metadata.test.ts). The async fakes already carried statementId.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

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