Skip to content

feat(sea): wire session-level query tags (statement-level already forwarded)#430

Open
msrathore-db wants to merge 1 commit into
mainfrom
msrathore/sea-query-tags-wiring
Open

feat(sea): wire session-level query tags (statement-level already forwarded)#430
msrathore-db wants to merge 1 commit into
mainfrom
msrathore/sea-query-tags-wiring

Conversation

@msrathore-db

Copy link
Copy Markdown
Contributor

Summary

Brings SEA query-tag handling to parity with the Thrift backend across both scopes.

Session-level (openSession({ queryTags })) — NEW

SeaBackend.openSession now serializes request.queryTags into the reserved QUERY_TAGS session conf, mirroring ThriftBackend.openSession. The kernel allowlists QUERY_TAGS and forwards it onto the SEA CreateSession session_confs. It runs after the configuration merge so queryTags takes precedence over an explicit configuration.QUERY_TAGS, per the documented contract. Previously SeaBackend.openSession ignored request.queryTags entirely (only configuration was forwarded).

Verified on a live warehouse (mitmproxy capture) that QUERY_TAGS reaches the /sessions request body.

Statement-level (executeStatement({ queryTags })) — already forwarded

SeaSessionBackend already serializes per-statement queryTags into statementConf.query_tags. That was a no-op end-to-end because the kernel dropped statement_conf before the SEA wire (confirmed via a live /statements capture). The companion kernel PR databricks/databricks-sql-kernel#150 adds the native query_tags array to ExecuteStatementRequest, so the existing driver forwarding now reaches the server.

⚠️ Dependency: statement-level query tags become functional once kernel #150 merges and KERNEL_REV is bumped. Session-level works today (the QUERY_TAGS session conf is already allowlisted). This PR intentionally does not bump KERNEL_REV.

Background (cross-driver parity)

  • JDBC: query tags are session-scoped (QUERY_TAGS session conf).
  • ADBC C# / pure-Python SEA: per-statement via the native SEA query_tags array.
  • Before this + kernel scientific notation negative numbers #150, SEA query tags were a complete no-op on the kernel path (both Node useSEA and Python use_kernel), while Thrift sent them via confOverlay.query_tags.

Test

  • openSession() serializes session-level queryTags into sessionConf.QUERY_TAGS.
  • queryTags takes precedence over an explicit configuration.QUERY_TAGS.
  • Statement-level forwarding (statementConf.query_tags) is already covered by existing tests.
  • SEA unit suite green; tsc + prettier clean.

This pull request and its description were written by Isaac.

…warded)

Brings SEA query-tag handling to parity with the Thrift backend across
both scopes:

- Session-level (`openSession({ queryTags })`): NEW — `SeaBackend.openSession`
  serializes `request.queryTags` into the reserved `QUERY_TAGS` session conf
  (the kernel allowlists `QUERY_TAGS` and forwards it onto the SEA
  `CreateSession` `session_confs`), mirroring `ThriftBackend.openSession`.
  Runs after the `configuration` merge so `queryTags` takes precedence over
  an explicit `configuration.QUERY_TAGS`, per the documented contract.
  Verified on a live warehouse that `QUERY_TAGS` reaches the `/sessions` wire.

- Statement-level (`executeStatement({ queryTags })`): already forwarded by
  `SeaSessionBackend` into `statementConf.query_tags`. Previously a no-op
  because the kernel dropped `statement_conf` before the SEA wire; the
  companion kernel PR (databricks-sql-kernel#150) adds the native
  `query_tags` array so it now reaches the server end-to-end. Functional
  once that lands + KERNEL_REV is bumped.

Tests: openSession serializes session-level queryTags into
sessionConf.QUERY_TAGS, and queryTags wins over an explicit
configuration.QUERY_TAGS. (Statement-level forwarding is already covered.)

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@msrathore-db msrathore-db deployed to azure-prod June 8, 2026 20:48 — with GitHub Actions Active
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