<?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: Genie Agent refuses to add scalar SQL function from Unity Catalog in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169824#M2105</link>
    <description>&lt;P&gt;Good news, Charl: I think we found it. I reproduced your error on a separate Azure workspace today and then tried the other path, which works.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Configure &amp;gt; Sources &amp;gt; Add &amp;gt; SQL function&lt;/STRONG&gt; rejects scalar functions with "You must select a function that returns a table". I tried a scalar with no arguments and one with a DATE parameter, and both were blocked. A table function wrapping the same value saved without problems. This is the "provide verified answers" dialog, and it only accepts table functions.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Configure &amp;gt; Examples &amp;gt; Add&lt;/STRONG&gt; accepts the same scalar function. It shows the definition along with the Parameters and Usage Guidance sections, and saves fine.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This matches the docs, which only describe adding functions through the Examples tab: "Use the Examples tab to add... SQL functions". What makes it confusing is that the Sources menu also lists "SQL function", so it looks like the natural place to add one.&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions" target="_blank" rel="noopener"&gt;https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you don't need the table wrapper. Add the scalar through Examples and fill in the Usage Guidance so Genie knows when to call it. It may still be worth flagging to the account team that the Sources path rejects scalar functions with an error that suggests they aren't supported at all.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2026 12:10:46 GMT</pubDate>
    <dc:creator>ThomazNeto</dc:creator>
    <dc:date>2026-09-25T12:10:46Z</dc:date>
    <item>
      <title>Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169062#M2080</link>
      <description>&lt;P&gt;We would like to add some scalar SQL functions to our Genie Agents, for context that can't be provided via other mechanisms. In testing this, we have discovered that scalar functions are not supported, although the documentation explicitly states that they are.&lt;BR /&gt;&lt;BR /&gt;The documentation at&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/genie-agents/tune-quality#how-does-genie-use-sql-functions" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/genie-agents/tune-quality#how-does-genie-use-sql-functions&lt;/A&gt;&amp;nbsp;states the following:&lt;/P&gt;&lt;P&gt;"Genie supports both scalar functions, which return a single value, and table-valued functions, which return a table of rows."&lt;BR /&gt;&lt;BR /&gt;When we attempt to attach a test UC scalar function, SQL or Python, that returns the number 42, it errors out with: "You must select a function that returns a table.", see attached screenshot.&lt;/P&gt;&lt;P&gt;Are the docs incorrect, or should the Genie Agent in fact support scalar functions, which would be convenient. In the meantime, we'll work around this by wrapping the scalar in a table.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2026 08:15:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169062#M2080</guid>
      <dc:creator>charl-p-botha</dc:creator>
      <dc:date>2026-09-18T08:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169296#M2084</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122949"&gt;@charl-p-botha&lt;/a&gt;&amp;nbsp;I think your reading is right. The current docs say Genie supports both scalar and table-valued Unity Catalog functions, and the &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/ai-bi/release-notes/2026" target="_blank" rel="noopener"&gt;August 27 release notes&lt;/A&gt; explicitly say that both can be attached as Genie Agent tool.&lt;/P&gt;&lt;P&gt;Given the UI message, the table-valued wrapper looks like a reasonable workaround for now rather than an intended requirement.&lt;/P&gt;&lt;P&gt;If it persists, it may be worth capturing the workspace cloud/region, function definition and &lt;EM&gt;DESCRIBE FUNCTION EXTENDED&lt;/EM&gt; output, then raising it with Support so they can check whether this is specific to the workspace or current UI behavior.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 09:29:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169296#M2084</guid>
      <dc:creator>ivanvyd</dc:creator>
      <dc:date>2026-09-21T09:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169303#M2085</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The tune-quality page (updated Sep 11) says "Genie supports both scalar functions, which return a single value, and table-valued functions, which return a table of rows", and the Aug 27 release note is explicit: "Agent authors can now attach both scalar and table-valued Unity Catalog functions as tools for a Genie Agent." Nowhere in the docs is there a "must return a table" restriction. So the UI message you're getting is either a rollout lag in your workspace or a bug, not intended behavior.&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions" target="_blank"&gt;https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/ai-bi/release-notes/2026" target="_blank"&gt;https://docs.databricks.com/aws/en/ai-bi/release-notes/2026&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Two things worth checking before you file it. First, where you're adding it: the docs describe the flow as Configure, then the Examples tab, SQL functions. If your workspace still shows an older add-function dialog somewhere else, that may be the one that hasn't caught up. Second, the function needs a proper COMMENT, since Genie can't see the body and only reasons over the description (the Sep 3 note added showing that description in the agent). A scalar returning 42 with no description won't be much use to the agent even once it attaches.&lt;/P&gt;&lt;P&gt;Your workaround is fine in the meantime, a one-row table function wrapping the scalar. When you open the ticket, include cloud/region, the CREATE FUNCTION statement and DESCRIBE FUNCTION EXTENDED output as Ivan suggested, plus a link to that Aug 27 release note so support can't argue it isn't supposed to work.&lt;/P&gt;&lt;P&gt;Would be good to hear back on what they say, this affects more people than just you.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 10:46:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169303#M2085</guid>
      <dc:creator>ThomazNeto</dc:creator>
      <dc:date>2026-09-21T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169814#M2104</link>
      <description>&lt;P&gt;Thank you both!&lt;/P&gt;&lt;P&gt;I have just tried again: The flow is Genie Agent / Configure / Sources / Add / SQL function. It still refuses with the error (shown in the screenshot below) that "You must select a function that returns a table."&lt;BR /&gt;&lt;BR /&gt;I will create a new Genie Agent and test again. If it still doesn't work, I'll take it further with our excellent account team.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="charlpbotha_0-1790332556603.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/31498iC74CF5F243C61EC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="charlpbotha_0-1790332556603.png" alt="charlpbotha_0-1790332556603.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2026 10:36:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169814#M2104</guid>
      <dc:creator>charl-p-botha</dc:creator>
      <dc:date>2026-09-25T10:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169824#M2105</link>
      <description>&lt;P&gt;Good news, Charl: I think we found it. I reproduced your error on a separate Azure workspace today and then tried the other path, which works.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Configure &amp;gt; Sources &amp;gt; Add &amp;gt; SQL function&lt;/STRONG&gt; rejects scalar functions with "You must select a function that returns a table". I tried a scalar with no arguments and one with a DATE parameter, and both were blocked. A table function wrapping the same value saved without problems. This is the "provide verified answers" dialog, and it only accepts table functions.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Configure &amp;gt; Examples &amp;gt; Add&lt;/STRONG&gt; accepts the same scalar function. It shows the definition along with the Parameters and Usage Guidance sections, and saves fine.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This matches the docs, which only describe adding functions through the Examples tab: "Use the Examples tab to add... SQL functions". What makes it confusing is that the Sources menu also lists "SQL function", so it looks like the natural place to add one.&lt;BR /&gt;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions" target="_blank" rel="noopener"&gt;https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you don't need the table wrapper. Add the scalar through Examples and fill in the Usage Guidance so Genie knows when to call it. It may still be worth flagging to the account team that the Sources path rejects scalar functions with an error that suggests they aren't supported at all.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2026 12:10:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169824#M2105</guid>
      <dc:creator>ThomazNeto</dc:creator>
      <dc:date>2026-09-25T12:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Genie Agent refuses to add scalar SQL function from Unity Catalog</title>
      <link>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169829#M2106</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks for reproducing this, &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245135"&gt;@ThomazNeto&lt;/a&gt;. &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122949"&gt;@charl-p-botha&lt;/a&gt;, I'd try &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Configure &amp;gt; Examples &amp;gt; Add&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; on your existing agent before recreating it. That matches the &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/genie-agents/tune-quality" target="_blank" rel="noopener"&gt;Azure documentation's route for adding SQL functions&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One small testing detail: your screenshot's function description already includes &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;42&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, so Genie returning 42 wouldn't by itself confirm that it executed the function. After saving, check the function / query details too: &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Show code&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; for a SQL response, or &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;Show more&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; for a trusted-function response in Chat mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If Examples still rejects it - or saves successfully but the function cannot be called - that's the specific distinction I'd take to your account team.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2026 12:44:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/genie-agent-refuses-to-add-scalar-sql-function-from-unity/m-p/169829#M2106</guid>
      <dc:creator>ivanvyd</dc:creator>
      <dc:date>2026-09-25T12:44:26Z</dc:date>
    </item>
  </channel>
</rss>

