feat(sea): wire session-level query tags (statement-level already forwarded)#430
Open
msrathore-db wants to merge 1 commit into
Open
feat(sea): wire session-level query tags (statement-level already forwarded)#430msrathore-db wants to merge 1 commit into
msrathore-db wants to merge 1 commit into
Conversation
…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>
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.
Summary
Brings SEA query-tag handling to parity with the Thrift backend across both scopes.
Session-level (
openSession({ queryTags })) — NEWSeaBackend.openSessionnow serializesrequest.queryTagsinto the reservedQUERY_TAGSsession conf, mirroringThriftBackend.openSession. The kernel allowlistsQUERY_TAGSand forwards it onto the SEACreateSessionsession_confs. It runs after theconfigurationmerge soqueryTagstakes precedence over an explicitconfiguration.QUERY_TAGS, per the documented contract. PreviouslySeaBackend.openSessionignoredrequest.queryTagsentirely (onlyconfigurationwas forwarded).Verified on a live warehouse (mitmproxy capture) that
QUERY_TAGSreaches the/sessionsrequest body.Statement-level (
executeStatement({ queryTags })) — already forwardedSeaSessionBackendalready serializes per-statementqueryTagsintostatementConf.query_tags. That was a no-op end-to-end because the kernel droppedstatement_confbefore the SEA wire (confirmed via a live/statementscapture). The companion kernel PR databricks/databricks-sql-kernel#150 adds the nativequery_tagsarray toExecuteStatementRequest, so the existing driver forwarding now reaches the server.Background (cross-driver parity)
QUERY_TAGSsession conf).query_tagsarray.useSEAand Pythonuse_kernel), while Thrift sent them viaconfOverlay.query_tags.Test
openSession()serializes session-levelqueryTagsintosessionConf.QUERY_TAGS.queryTagstakes precedence over an explicitconfiguration.QUERY_TAGS.statementConf.query_tags) is already covered by existing tests.tsc+ prettier clean.This pull request and its description were written by Isaac.