<?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 Genie &amp;quot;Field&amp;quot; error:  Table name or alias is required for column 'amount' in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/172814#M56675</link>
    <description>&lt;P&gt;The documentation at&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#define-sql-expressions" target="_blank"&gt;https://docs.databricks.com/aws/en/genie-agents/tune-quality#define-sql-expressions&lt;/A&gt;&amp;nbsp;says that you can create a "Field" in a genie agent (in the Examples section of config) with the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;SPAN&gt;CASE WHEN amount &amp;lt; 10000 THEN 'Small' WHEN amount &amp;lt; 50000 THEN 'Medium' ELSE 'Large' END&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, entering this code yields an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Table name or alias is required for column 'amount'&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;presumably because the field names aren't specified as belonging to a specific table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So #1, that's an error in the documentation, right?&lt;/P&gt;&lt;P&gt;#2, what does "alias" mean in the error message?&amp;nbsp; I get that if I were creating an example Query, I could create table aliases for the result of the query.&amp;nbsp; But such aliases do not appear to be valid for using in the Field definition.&lt;/P&gt;&lt;P&gt;Is there a separate method for defining an "alias" in the context of a Genie Agent?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="field.png" style="width: 369px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/32041i8C2BF5EDCCCDF2A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="field.png" alt="field.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2026 16:24:44 GMT</pubDate>
    <dc:creator>dkxxx-rc</dc:creator>
    <dc:date>2026-10-12T16:24:44Z</dc:date>
    <item>
      <title>Genie "Field" error:  Table name or alias is required for column 'amount'</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/172814#M56675</link>
      <description>&lt;P&gt;The documentation at&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#define-sql-expressions" target="_blank"&gt;https://docs.databricks.com/aws/en/genie-agents/tune-quality#define-sql-expressions&lt;/A&gt;&amp;nbsp;says that you can create a "Field" in a genie agent (in the Examples section of config) with the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;SPAN&gt;CASE WHEN amount &amp;lt; 10000 THEN 'Small' WHEN amount &amp;lt; 50000 THEN 'Medium' ELSE 'Large' END&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, entering this code yields an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Table name or alias is required for column 'amount'&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;presumably because the field names aren't specified as belonging to a specific table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So #1, that's an error in the documentation, right?&lt;/P&gt;&lt;P&gt;#2, what does "alias" mean in the error message?&amp;nbsp; I get that if I were creating an example Query, I could create table aliases for the result of the query.&amp;nbsp; But such aliases do not appear to be valid for using in the Field definition.&lt;/P&gt;&lt;P&gt;Is there a separate method for defining an "alias" in the context of a Genie Agent?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="field.png" style="width: 369px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/32041i8C2BF5EDCCCDF2A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="field.png" alt="field.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 16:24:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/172814#M56675</guid>
      <dc:creator>dkxxx-rc</dc:creator>
      <dc:date>2026-10-12T16:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Genie "Field" error:  Table name or alias is required for column 'amount'</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/172820#M56677</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/137009"&gt;@dkxxx-rc&lt;/a&gt;, &lt;/STRONG&gt;Greetings.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#1 — Documentation inconsistency:&lt;/STRONG&gt;&lt;SPAN&gt; Yes, this appears to be an error in the docs. Notice that the &lt;/SPAN&gt;&lt;STRONG&gt;Filter&lt;/STRONG&gt;&lt;SPAN&gt; example on the same page correctly qualifies the column: &lt;/SPAN&gt;orders.amount &amp;gt; 10000&lt;SPAN&gt;, but the &lt;/SPAN&gt;&lt;STRONG&gt;Field&lt;/STRONG&gt;&lt;SPAN&gt; example leaves &lt;/SPAN&gt;amount&lt;SPAN&gt; unqualified. The Genie Agent expression engine requires column references to be qualified with the tabl&lt;/SPAN&gt;&lt;SPAN&gt;e name, so the Field example should read something like &lt;/SPAN&gt;CASE WHEN orders.amount &amp;lt; 10000 THEN 'Small' ...&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#2 — What "alias" means here:&lt;/STRONG&gt; In this context, "alias" refers to the &lt;STRONG&gt;table name as it's registered in the Genie Agent&lt;/STRONG&gt;. When you add a table to the agent (e.g., catalog.schema.orders), the expression parser expects you to reference columns using that table name as a prefix — orders.amount, not just amount. There is no separate mechanism to define custom aliases like you would in a SQL FROM clause (FROM orders AS o).&lt;/P&gt;&lt;P&gt;From your screenshot, t in COUNT(DISTINCT t.Author Identifier) is rejected because t isn't the name of any table in your agent. You'd need to use the actual table name as it appears in the agent's table list — e.g., if the table is my_catalog.my_schema.publications, you'd write COUNT(DISTINCT publications.\Author Identifier`)`.&lt;/P&gt;&lt;P&gt;So,&amp;nbsp; "table name or alias" in the error is the last segment of the fully qualified table name registered in your agent — that's the only valid qualifier for column references in these expressions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 16:39:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/172820#M56677</guid>
      <dc:creator>VK210287</dc:creator>
      <dc:date>2026-10-12T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Genie "Field" error:  Table name or alias is required for column 'amount'</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/173163#M56703</link>
      <description>&lt;P&gt;Greetings &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/137009"&gt;@dkxxx-rc&lt;/a&gt;, I did some digging and here is what I found.&lt;/P&gt;
&lt;P&gt;Vannurswamy Kuruba already nailed the core of this, so I'll build on his reply.&lt;/P&gt;
&lt;P&gt;On #1: yes, it's a doc inconsistency. On the same page, the Filter example qualifies the column (&lt;CODE&gt;orders.amount &amp;gt; 10000&lt;/CODE&gt;), but the Field example uses a bare &lt;CODE&gt;amount&lt;/CODE&gt;. The Measure example is unqualified too. The fix is to prefix the column with the table name as it appears under Configure &amp;gt; Sources:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;CASE
  WHEN orders.amount &amp;lt; 10000 THEN 'Small'
  WHEN orders.amount &amp;lt; 50000 THEN 'Medium'
  ELSE 'Large'
END
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On #2: there's no way to declare your own alias in a Field. It's an expression, not a query, so there's no &lt;CODE&gt;FROM ... AS ...&lt;/CODE&gt; where &lt;CODE&gt;t&lt;/CODE&gt; could come from. My read is that "alias" refers to names Genie generates itself. The docs mention it does this for the right-hand table in self-joins or repeated joins. The docs don't describe any user-defined alias syntax, so the actual table name is the safe bet.&lt;/P&gt;
&lt;P&gt;One more thing from your screenshot: &lt;CODE&gt;Author Identifier&lt;/CODE&gt; has a space, so it needs backticks, something like &lt;CODE&gt;COUNT(DISTINCT publications.`Author Identifier`)&lt;/CODE&gt;. Swap in your real table name.&lt;/P&gt;
&lt;P&gt;If the qualified version still fails, post the table name as shown under Sources, the exact expression, and whether the agent has joins or multiple tables. At that point it may be a product validation issue rather than a SQL one. It's also worth using the feedback option on the doc page so the examples get fixed.&lt;/P&gt;
&lt;P&gt;References:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#define-sql-expressions" target="_blank"&gt;Define SQL expressions in Genie Agents&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://docs.databricks.com/aws/en/genie-agents/tune-quality#-define-join-relationships" target="_blank"&gt;Define join relationships (auto-generated aliases note)&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards, Louis.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2026 07:36:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-quot-field-quot-error-table-name-or-alias-is-required-for/m-p/173163#M56703</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2026-10-14T07:36:07Z</dc:date>
    </item>
  </channel>
</rss>

