ThomazNeto
Databricks Partner

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.

  • Configure > Sources > Add > SQL function 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.
  • Configure > Examples > Add accepts the same scalar function. It shows the definition along with the Parameters and Usage Guidance sections, and saves fine.

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.
https://docs.databricks.com/aws/en/genie-agents/tune-quality#how-does-genie-use-sql-functions

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.

Thomaz A. Rossito Neto
Principal Data Architect & AI Strategy — CI&T
thomazn@ciandt.com
linkedin.com/in/thomaz-antonio-rossito-neto | Databricks Solutions Architect Champion