Skip to content

Databricks: Support SET QUERY_TAGS - #3083

Open
romanb wants to merge 1 commit into
apache:mainfrom
romanb:databricks-set-query-tags
Open

romanb wants to merge 1 commit into
apache:mainfrom
romanb:databricks-set-query-tags

Conversation

@romanb

@romanb romanb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Dialects: Databricks, Generic

Databricks sets session query tags with SET QUERY_TAGS. The bracketed form currently fails with Expected: equals sign or TO, found: [:

  SET QUERY_TAGS['team'] = 'engineering', QUERY_TAGS['env'] = 'prod', QUERY_TAGS['cost_center'] = UNSET;
  SET QUERY_TAGS['experiment'] = NULL;
  SET QUERY_TAGS;

This PR adds Set::SetQueryTags and Dialect::supports_set_query_tags(), enabled for Databricks and Generic.

Syntax: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-query-tags

This change was co-authored with Claude Code.

Parse `SET QUERY_TAGS[<key>] = <value> [, ...]` and the bare `SET QUERY_TAGS`
into the new `Set::SetQueryTags`, for dialects with `supports_set_query_tags()`
(Databricks and Generic).

See https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-query-tags

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.64%. Comparing base (540e398) to head (661b4b5).

Files with missing lines Patch % Lines
src/parser/mod.rs 69.23% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3083      +/-   ##
==========================================
- Coverage   83.64%   83.64%   -0.01%     
==========================================
  Files          42       42              
  Lines       35833    35879      +46     
  Branches    35833    35879      +46     
==========================================
+ Hits        29974    30012      +38     
  Misses       2418     2418              
- Partials     3441     3449       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants