Skip to content

[SEA-NodeJS] (7/9) Operation lifecycle — cancel / close / finished#384

Draft
msrathore-db wants to merge 3 commits into
msrathore/sea-resultsfrom
msrathore/sea-operation
Draft

[SEA-NodeJS] (7/9) Operation lifecycle — cancel / close / finished#384
msrathore-db wants to merge 3 commits into
msrathore/sea-resultsfrom
msrathore/sea-operation

Conversation

@msrathore-db
Copy link
Copy Markdown
Contributor

Summary

`SeaOperationLifecycle` wires `cancel()`, `close()`, and the `finished()` 100ms-poll surface. The poll is a JS-side no-op that resolves immediately (kernel's `Statement::execute().await` already blocks until complete). Includes a binding-side StatementInner ValidityFlag fix.

Stack position

PR 7/9. Cancel observed at 64–80ms.

@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).

Rust source changes (native/sea/src/connection.rs + statement.rs) deferred to kernel repo PR #29 (kernel-napi-statement-validity) since napi/src now lives in databricks-sql-kernel/napi/.

SeaOperationBackend.ts conflict resolved using integration commit 3da7aa7 (combining sea-results fetch pipeline with sea-operation lifecycle helpers).
- YEAR-MONTH: convert Arrow Interval[YearMonth] to thrift "N-M" string
  format (with leading "-" for negatives) in Phase 1 of converter
- DAY-TIME: pre-process IPC schema bytes before apache-arrow@13 decode
  (which predates the Arrow Duration type id 18) to remap Duration ->
  Int64 with original time unit preserved in `databricks.arrow.duration_unit`
  field metadata; convert Int64 duration values to thrift
  "D HH:mm:ss.fffffffff" string format

Both interval flavours are formatted by the same converter helper
(formatDayTimeFromTotal); the duration_unit metadata gates between the
native Arrow Interval Int32Array path and the rewritten Duration Int64
path. No apache-arrow bump, no node_modules edits, no kernel-side change.

New: lib/sea/SeaArrowIpcDurationFix.ts (FlatBuffer rewriter using
apache-arrow's internal fb/* accessors).

M0 datatype parity now 25/25.
Resolves the modify/delete conflict from merging sea-napi-binding:
sea-integration had the StatementInner ValidityFlag fix in
native/sea/src/statement.rs (inherited via sea-operation merge), while
sea-napi-binding wants those files deleted because the Rust source
now lives in the kernel workspace at databricks-sql-kernel/napi/.

Resolution: propagate the StatementInner fix to the kernel napi crate
(commit a8d8df7 on krn-napi-binding), then accept the deletion here.
Built artifacts (.node, .d.ts) are repopulated by
`npm run build:native` which delegates to the kernel workspace.

native/sea/ now contains only README.md and the generated index.d.ts;
index.linux-x64-gnu.node sits next to it as a build artifact.
@msrathore-db msrathore-db force-pushed the msrathore/sea-operation branch from e06a5e8 to 9b057f0 Compare May 17, 2026 13:22
@msrathore-db msrathore-db changed the base branch from main to msrathore/sea-results May 17, 2026 13:22
@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).

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