Skip to content

docs(sea): update SEA feature matrix — F1/F2/F3/F3b/F4 implementations + 3 corrections - #77

Closed
msrathore-db wants to merge 2 commits into
mainfrom
msrathore/sea-matrix-update
Closed

msrathore-db wants to merge 2 commits into
mainfrom
msrathore/sea-matrix-update

Conversation

@msrathore-db

Copy link
Copy Markdown
Collaborator

Summary

Lands napi-binding/docs/sea-feature-matrix.md on main as a single signed commit. The file previously existed as an untracked working draft on the msrathore/kernel-napi-classes branch's worktree — this PR makes it canonical so the source-of-truth doesn't depend on a per-developer working tree, and the matrix can be kept current independently of the in-flight feature stack.

Status flips for the 6 in-flight SEA implementation PRs

Section 2 (Session / Connection):

  • Connection pool (max_connections) NodeJS SEA: N → PR (#74 / #392) — SEA-only extension (Thrift doesn't expose this knob)
  • Complex types as Arrow (not JSON strings) NodeJS SEA: N → Y — kernel default complex_types_as_json=false; e2e-locked against pecotesting

Section 3 (Statement / Execution):

  • Async execute (submit + poll) NodeJS SEA: N → PR (#76 / #394) — napi `AsyncStatement` + `AsyncResultHandle`
  • Compound types (ARRAY/MAP/STRUCT as Arrow) NodeJS SEA: N → Y — same kernel default; e2e-locked
  • Statement conf map NodeJS SEA: N → PR (#75 / #393) — `ExecuteOptions.statementConf`
  • Query tags NodeJS SEA: N → PR (#75 / #393) — byte-identical Thrift `serializeQueryTags` wire shape

Section 4 (Result / Fetch):

Three matrix corrections

Each row was verified by re-reading the cited Thrift source path before flipping.

Row Old New Reason
Wait timeout / queryTimeout Thrift N Y lib/contracts/IDBSQLSession.ts:13 declares `queryTimeout?: number`; lib/DBSQLSession.ts:220 forwards to `TExecuteStatementReq.queryTimeout`
Row limit Thrift Y N ExecuteStatementOptions (lib/contracts/IDBSQLSession.ts:7-30) has NO `rowLimit` field. Only way to cap rows on Thrift is `LIMIT N` in SQL
Max rows per fetch row split single semantic semantics divergence note added Thrift's `maxRows` is "direct-results first-batch hint"; Python `use_sea`'s `max_rows=` is "per-fetch row cap" — different features sharing a name

Notes 5 and 6 added to spell out the row_limit kernel-internal-only state and the max-rows-per-fetch semantics divergence.

Cross-PR refs

PR Repo Branch
#74 kernel msrathore/krn-max-connections
#75 kernel msrathore/krn-statement-options
#76 kernel msrathore/krn-async-execute
#392 nodejs msrathore/sea-max-connections
#393 nodejs msrathore/sea-statement-options
#394 nodejs msrathore/sea-async-execute

What this PR is NOT

Test plan

  • Markdown renders correctly (verified locally; 219 lines)
  • All status flips trace to a concrete commit on a pushed PR branch
  • Three corrections each cite Thrift source-of-truth file:line
  • Two new notes (5 and 6) explain the row_limit kernel-internal-state and max-rows-per-fetch semantics divergence
  • git push succeeded; branch created cleanly off origin/main

…s + 3 corrections

Lands the SEA feature matrix at `napi-binding/docs/sea-feature-matrix.md`
on `main`. The file previously lived as an untracked working draft in the
`msrathore/kernel-napi-classes` worktree; this commit makes it canonical
so the source-of-truth doesn't depend on a per-developer working tree.

## Status flips for the 6 in-flight SEA implementation PRs

Section 2 (Session / Connection):
- `Connection pool (max_connections)` NodeJS SEA: N → PR (#74 / #392) — SEA-only extension (Thrift doesn't expose this knob)
- `Complex types as Arrow (not JSON strings)` NodeJS SEA: N → Y (kernel default, e2e-locked PR #392 against pecotesting)

Section 3 (Statement / Execution):
- `Async execute (submit + poll)` NodeJS SEA: N → PR (#76 / #394) — napi `AsyncStatement` + `AsyncResultHandle`
- `Compound types (ARRAY/MAP/STRUCT as Arrow)` NodeJS SEA: N → Y (kernel default, e2e-locked PR #392)
- `Statement conf map` NodeJS SEA: N → PR (#75 / #393 — `ExecuteOptions.statementConf`)
- `Query tags` NodeJS SEA: N → PR (#75 / #393 — byte-identical Thrift `serializeQueryTags` wire shape)

Section 4 (Result / Fetch):
- `Fetch all (drain to table)` NodeJS SEA: N → Y (facade `DBSQLOperation.fetchAll` already routes through `SeaOperationBackend.fetchChunk`; e2e regression-locked PR #393)

## Three matrix corrections found while researching

These three rows had Thrift-side claims that didn't match the Thrift
code. Verified each by re-reading the cited Thrift source path.

1. **Wait timeout / queryTimeout — Thrift: N → Y**
   `lib/contracts/IDBSQLSession.ts:13` declares
   `queryTimeout?: number | bigint | Int64` on `ExecuteStatementOptions`;
   `lib/DBSQLSession.ts:220` forwards it to `TExecuteStatementReq.queryTimeout`.
   The matrix previously said Thrift = N (matched only the
   "explicitly rejected on SEA" note); the public Thrift surface DOES
   expose this knob. Corrected.

2. **Row limit — Thrift: Y → N**
   `lib/contracts/IDBSQLSession.ts:7-30` enumerates `ExecuteStatementOptions`
   fields: `queryTimeout`, `maxRows`, `useCloudFetch`, `useLZ4Compression`,
   `stagingAllowedLocalPath`, `namedParameters`, `ordinalParameters`,
   `queryTags`. NO `rowLimit`. The only way to cap rows on the Thrift
   path is `LIMIT N` in the SQL itself. Corrected; new note 5 explains
   the kernel-side `ExecuteParams.row_limit` field that's wire-present
   but not on `StatementSpec`.

3. **Max rows per fetch — semantics divergence (single row was conflating two features)**
   Thrift's `maxRows` is a "direct-results first-batch hint" populating
   `TExecuteStatementReq` via `getDirectResultsOptions`; Python `use_sea`'s
   `max_rows=` is a "per-fetch row cap" on `fetch_many_arrow`. They are
   not the same feature despite sharing a name. The SEA path through the
   kernel uses Arrow-batch streaming with server-driven batch sizing, so
   neither maps cleanly. Listed as "deferred — concept does not map cleanly"
   for NodeJS SEA. New note 6 documents the semantics divergence.

## Cross-PR refs

Implementation PRs cited in the matrix:
- #74 `msrathore/krn-max-connections` (kernel — napi `maxConnections`)
- #75 `msrathore/krn-statement-options` (kernel — napi `ExecuteOptions`)
- #76 `msrathore/krn-async-execute` (kernel — napi `AsyncStatement`)
- #392 `msrathore/sea-max-connections` (NodeJS — F1 + F2)
- #393 `msrathore/sea-statement-options` (NodeJS — F3 + F4)
- #394 `msrathore/sea-async-execute` (NodeJS — F3b)

## What this PR is NOT

- No code changes. Documentation only.
- Does NOT depend on any of #74/#75/#76/#392/#393/#394 being merged
  first — the matrix can land independently and stay current as the
  rest of the stack lands.
- Does NOT touch PR #25's branch (which holds the prior working-draft
  copy of this file). Putting the file on `main` avoids dismissing
  PR #25's approvals.

## What still belongs in the matrix as deferred (per scope rubric)

- Positional/named params, TIMESTAMP/_NTZ/_LTZ/VARIANT params, row_limit:
  documented as "still deferred" in the updated Section 6 gaps subsection,
  with the kernel-side `StatementSpec` extension noted as the blocking
  prerequisite for row_limit.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
…nf map

Add a Quick-reference section at the top mapping the six implementation
PRs (#74/#75/#76/#392/#393/#394) to features + test counts, plus a
Python comparison table showing how each feature maps to Python's
`use_sea=True` / `use_kernel=True` reference implementations.

Scope-down the Statement conf map + Query tags rows in Section 3 to
clarify the implementation is napi-only — the public NodeJS
`ExecuteStatementOptions` surface does not yet expose them. Wiring to
public API is a follow-up increment. Documented as Note 7. Addresses
DA's round-3 PR #77 review point on Statement conf map scope.

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

Copy link
Copy Markdown
Collaborator Author

Closing — this is internal working documentation, not appropriate for the kernel repo. The SEA feature matrix references internal-only NodeJS workflow decisions, private PR numbers across the NodeJS repo, and team-internal jira-candidate references. Keeping it as a local reference doc instead. Branch msrathore/sea-matrix-update retained for now in case its content needs to be re-pulled locally.

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