<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set query_tags in system.query.history in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/148244#M52853</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/153311"&gt;@hobrob_ex&lt;/a&gt;&amp;nbsp;! Good Day!&lt;/P&gt;
&lt;P&gt;We now have the querytags feature available in Public Preview. Please find the docs here:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/sql/user/queries/query-tags" target="_blank" rel="noopener noreferrer" data-sk="tooltip_parent"&gt;https://docs.databricks.com/aws/en/sql/user/queries/query-tags&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Feb 2026 01:11:01 GMT</pubDate>
    <dc:creator>K_Anudeep</dc:creator>
    <dc:date>2026-02-13T01:11:01Z</dc:date>
    <item>
      <title>How to set query_tags in system.query.history</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/145531#M52524</link>
      <description>&lt;P&gt;I've been trying to see if there's a way to have metadata included in query logging in a similar way to query banding in Teradata, and I've come across the field query_tags in system.query.history. However, I can't find any reference to it in the Databricks documentation that explains how to populate it, I've only found mention of it in what looks like some third-party DBT documentation here:-&amp;nbsp;&lt;A href="https://deepwiki.com/databricks/dbt-databricks/6.1-query-tags-and-context" target="_blank"&gt;Query Tags and Context | databricks/dbt-databricks | DeepWiki&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Presumably if this is a Databricks feature leveraged by DBT, it must be running some SQL to set query tag values. Does anyone know what that syntax is?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2026 13:12:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/145531#M52524</guid>
      <dc:creator>hobrob_ex</dc:creator>
      <dc:date>2026-01-28T13:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to set query_tags in system.query.history</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/145634#M52553</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/153311"&gt;@hobrob_ex&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;query_tags &lt;/STRONG&gt;is a Databricks feature, but (as of the current docs) it’s not set via a SQL statement like Teradata query banding / Snowflake ALTER SESSION&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A per the docs, you need to pass it via session configuration&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;from databricks import sql

with sql.connect(
    server_hostname="...",
    http_path="...",
    access_token="...",
    session_configuration={"query_tags": "team:engineering,dashboard:abc123,env:prod"}
) as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT 1")
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Doc link:&lt;/STRONG&gt;&lt;A href="https://docs.databricks.com/aws/en/dev-tools/python-sql-connector#query-tags" target="_blank" rel="noopener"&gt;https://docs.databricks.com/aws/en/dev-tools/python-sql-connector#query-tags&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 02:55:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/145634#M52553</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2026-01-29T02:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to set query_tags in system.query.history</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/148244#M52853</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/153311"&gt;@hobrob_ex&lt;/a&gt;&amp;nbsp;! Good Day!&lt;/P&gt;
&lt;P&gt;We now have the querytags feature available in Public Preview. Please find the docs here:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/sql/user/queries/query-tags" target="_blank" rel="noopener noreferrer" data-sk="tooltip_parent"&gt;https://docs.databricks.com/aws/en/sql/user/queries/query-tags&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 01:11:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/148244#M52853</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2026-02-13T01:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to set query_tags in system.query.history</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/148264#M52857</link>
      <description>&lt;P&gt;Hey Anudeep, Good day to you too!&lt;BR /&gt;&lt;BR /&gt;That's great news, setting the tags via SQL is just what I need! Out of interest, was that already in the pipeline or was it implemented as a response to my query?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 08:28:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-set-query-tags-in-system-query-history/m-p/148264#M52857</guid>
      <dc:creator>hobrob_ex</dc:creator>
      <dc:date>2026-02-13T08:28:09Z</dc:date>
    </item>
  </channel>
</rss>

