Repository navigation
feat(sea): send per-statement query tags on the wire (native query_tags array) - #150
Merged
Merged
Conversation
…gs array)
Per-statement query tags set via `Statement::query_tags` (napi/pyo3
`set_query_tags`) or a raw `statement_conf["query_tags"]` were stored on
the spec but never reached the server: `build_execute_params` ignored
`statement_conf` and `ExecuteStatementRequest` had no conf/query_tags
field, so the SEA `POST /statements` body dropped them silently. (The SEA
API has no conf overlay, unlike Thrift's `confOverlay`.)
The SEA API takes query tags as a native top-level `query_tags` array of
`{key, value}` objects — the same wire shape the pure-Python SEA backend
and the ADBC C# driver send. This wires that:
- `types::sea`: add `QueryTag { key, value }` + `query_tags: Vec<QueryTag>`
on `ExecuteStatementRequest` (skipped when empty) and `ExecuteParams`.
- `spec`: add `deserialize_query_tags` — the inverse of the existing
`serialize_query_tags` escaping — so the single serialized conf string
(where both input paths converge) is converted to the structured array.
- `build_execute_params`: populate `ExecuteParams.query_tags` from
`statement_conf["query_tags"]`. Applies to all execute paths (sync,
async/submit, direct) since they share the params builder + call_execute_api.
Fixes per-statement query tags for every binding on the SEA path (Node
`useSEA` and Python `use_kernel`), bringing them to parity with Thrift's
`confOverlay.query_tags`. Session-level query tags (`QUERY_TAGS` session
conf) already reach the wire via the session-conf allowlist.
Tests: deserialize round-trip + escaping edge cases; build_execute_params
threads tags to the array; request serializes the native `[{key,value}]`
shape with value omitted for bare keys.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
force-pushed
the
msrathore/sea-statement-query-tags
branch
from
June 9, 2026 10:16
a1eb79d to
273c1fc
Compare
gopalldb
approved these changes
Jun 9, 2026
This branch was previously deployed
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.
Problem
Per-statement query tags set via
Statement::query_tags(the napi/pyo3set_query_tagsbindings) — or a rawstatement_conf["query_tags"]— were stored on the spec but never sent to the server.build_execute_paramsignoredstatement_conf, andExecuteStatementRequesthad no conf/query-tags field, so the SEAPOST /statementsbody dropped them silently.This was confirmed on a live warehouse (mitmproxy capture): a tagged statement's
/statementsbody contained noquery_tags. It affects every binding on the SEA path — Node.jsuseSEAand Pythonuse_kernel— while the Thrift path sends them viaconfOverlay.query_tags(verified on the wire). So the two backends were not at parity.Fix
The SEA API takes query tags as a native top-level
query_tagsarray of{key, value}objects — the same wire shape the pure-Python SEA backend and the ADBC C# driver already send (the SEA request has no conf overlay, unlike Thrift). This wires that:types::sea: addQueryTag { key, value }andquery_tags: Vec<QueryTag>onExecuteStatementRequest(omitted when empty) andExecuteParams.spec: adddeserialize_query_tags— the inverse of the existingserialize_query_tagsescaping — so the single serialized conf string (where both input paths converge) is converted to the structured array.build_execute_params: populateExecuteParams.query_tagsfromstatement_conf["query_tags"]. Covers all execute paths (sync, async/submit, direct) since they share the params builder andcall_execute_api.No binding API changes:
Statement::query_tagsis unchanged; the conversion happens at the wire boundary.Result
useSEAand Pythonuse_kernel.QUERY_TAGSsession conf) already reach the wire via the session-conf allowlist — unchanged.Tests
deserialize_query_tags: round-trip withserialize_query_tags, plus escaping edge cases (value\:/\,/\\, key backslash, bare key →None, empty value after colon).build_execute_params: threads tags into the native array; empty when none set.ExecuteStatementRequest: serializes the native[{key,value}]shape withvalueomitted for bare keys; empty array omitted.This pull request and its description were written by Isaac.