live wire
▸EKOS submits 70.15% on BIRD’s hidden test and 88.33% on Mini-Dev with different Claude models; both entries are pendingBIRD submission PR #270▸MotherDuck rolls out DuckDB 2.0 with async I/O and reports faster cold reads in TPC-H and TPC-DS testsMotherDuck▸ThoughtSpot Spotter starts rolling out answer explanations for token-based results, not AgentQLThoughtSpot▸Snowflake previews Z.ai GLM 5.4 in Cortex Inference, but not in Cortex AgentsSnowflake release notes▸Removing Vietnamese diacritics cut text-to-SQL accuracy by 10.3–37.0 points across four models in an author studyLe Trung et al., Vietnamese MultiSpider artifacts▸Avelis 1.7 adds AI-built dashboards and reruns pinned exploratory SQL under each viewer’s permissionsAvelis release notes▸Aurora MySQL previews cluster groups with one routing endpoint; each query still runs on one clusterAWS What's New▸Rewind-HNSW uses 86.9% less memory than full snapshots in authors’ 20-version testsShea et al., Rewind-HNSW §5.5▸Snowflake previews pausing downstream dynamic table refreshes when data quality checks failSnowflake release notes▸BigQuery previews optional GoogleSQL optimization suggestions in its interactive SQL translatorGoogle Cloud documentation▸Snowflake extends its Tableau and Power BI dashboard migration preview to Azure deploymentsSnowflake release notes▸Google Cloud makes it generally available to unpublish Iceberg data shares from SAP Business Data CloudGoogle Cloud — BigQuery and Lakehouse documentation▸AWS previews organization-wide cost questions in Ops Agent for FinOpsAWS What's New▸Looker updates require API login credentials in the request body, not the URLGoogle Cloud — Looker documentation▸EKOS submits 70.15% on BIRD’s hidden test and 88.33% on Mini-Dev with different Claude models; both entries are pendingBIRD submission PR #270▸MotherDuck rolls out DuckDB 2.0 with async I/O and reports faster cold reads in TPC-H and TPC-DS testsMotherDuck▸ThoughtSpot Spotter starts rolling out answer explanations for token-based results, not AgentQLThoughtSpot▸Snowflake previews Z.ai GLM 5.4 in Cortex Inference, but not in Cortex AgentsSnowflake release notes▸Removing Vietnamese diacritics cut text-to-SQL accuracy by 10.3–37.0 points across four models in an author studyLe Trung et al., Vietnamese MultiSpider artifacts▸Avelis 1.7 adds AI-built dashboards and reruns pinned exploratory SQL under each viewer’s permissionsAvelis release notes▸Aurora MySQL previews cluster groups with one routing endpoint; each query still runs on one clusterAWS What's New▸Rewind-HNSW uses 86.9% less memory than full snapshots in authors’ 20-version testsShea et al., Rewind-HNSW §5.5▸Snowflake previews pausing downstream dynamic table refreshes when data quality checks failSnowflake release notes▸BigQuery previews optional GoogleSQL optimization suggestions in its interactive SQL translatorGoogle Cloud documentation▸Snowflake extends its Tableau and Power BI dashboard migration preview to Azure deploymentsSnowflake release notes▸Google Cloud makes it generally available to unpublish Iceberg data shares from SAP Business Data CloudGoogle Cloud — BigQuery and Lakehouse documentation▸AWS previews organization-wide cost questions in Ops Agent for FinOpsAWS What's New▸Looker updates require API login credentials in the request body, not the URLGoogle Cloud — Looker documentation
nl2sql.ai
guideSQL AGENT FIELD GUIDE

Snowflake GROUP BY can split a bucket when its alias matches a source column

A query can show two rows labeled Paid while grouping on the original payment statuses. Check the grouping key, not just the output label or grand total.

By The News Desk· Nov 29, 2026the quick take — two AI hosts go live when you do

Ask a SQL agent for payment totals by reporting status, with both paid and settled counted as Paid. In Snowflake, a query can apply that mapping in the output and still group by the original statuses. The giveaway is two rows that both say Paid. The grand total can be correct even though the requested breakdown is wrong.

The displayed label is not always the grouping key

Snowflake’s GROUP BY reference documents the precedence rule: when an unqualified name matches both a source column and a SELECT alias, the source column wins. Its worked example demonstrates that the grouping can follow one field while the displayed label comes from another. Here is an illustrative payment fixture applying the same rule without relying on an arbitrary representative value:

WITH payments(status, amount) AS (
  SELECT * FROM VALUES ('paid', 40), ('settled', 60), ('pending', 25)
)
SELECT CASE WHEN status IN ('paid', 'settled') THEN 'Paid'
            ELSE status END AS status,
       SUM(amount) AS total
FROM payments
GROUP BY status;

Under the documented rule, GROUP BY status binds to the input column. The expected result for this fixture, ignoring row order, is Paid: 40, Paid: 60, and pending: 25. Summing those rows gives 125, so a grand-total check alone would not catch the split. Those figures are derived from the fixture, not a production measurement.

Name the reporting bucket before aggregating

WITH payments(status, amount) AS (
  SELECT * FROM VALUES ('paid', 40), ('settled', 60), ('pending', 25)
), classified AS (
  SELECT CASE WHEN status IN ('paid', 'settled') THEN 'Paid'
              ELSE status END AS reporting_status,
         amount
  FROM payments
)
SELECT c.reporting_status, SUM(c.amount) AS total
FROM classified AS c
GROUP BY c.reporting_status;

Now the outer query groups by the actual reporting column. The expected output is one Paid row totaling 100 and one pending row totaling 25. For an agent regression test, include at least two raw statuses that map to the same label and assert both the number of rows for that label and its total. A fixture with only one raw status per label won’t expose the mistake.

Filed by The News Desk. Corrections: desk@nl2sql.ai · Our standards →

comments · 0

    Comments are moderated before they appear. Your email is used once to confirm it is you — never shown, never sold. Corrections and questions get an answer from the desk when we have one.