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 PRACTICE

Snowflake REGR_R2 can return 1 when the outcome never changes

Before calling a regression a perfect fit, check whether the outcome varied at all on the same rows used by the model.

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

A dashboard asks, “How well does ad spend explain weekly signups?” Snowflake’s REGR_R2(signups, spend) can return 1 even if signups were identical every week. The number is valid under Snowflake’s documented rule, but a summary that says “spend explains all the variation in signups” misses the point: there was no variation in signups to explain.

Two ways to get a 1

Snowflake evaluates the rule on rows where both inputs are non-null. If the predictor (x, spend) has zero variance, REGR_R2 returns NULL. If spend varies but the outcome (y, signups) has zero variance, it returns 1. When both vary, it returns squared correlation. That means both a flat outcome and a genuinely straight-line relationship can produce the same score. The argument order matters: outcome first, predictor second.

Check the variation on the same rows

Use REGR_SXX and REGR_SYY beside REGR_R2. They measure the spread of the predictor and outcome, respectively, as the pair count times the population variance, calculated on the same complete pairs. Separate variances over each column need not use the same rows: a week with spend but missing signups contributes to a spend-only variance but not to the regression.

WITH weekly(campaign, signups, spend) AS (
  SELECT * FROM VALUES
    ('flat', 20, 100), ('flat', 20, 200), ('flat', 20, 300),
    ('line', 10, 100), ('line', 20, 200), ('line', 30, 300),
    ('fixed', 10, 100), ('fixed', 20, 100), ('fixed', 30, 100)
)
SELECT campaign,
       REGR_R2(signups, spend) AS r_squared,
       REGR_SXX(signups, spend) AS spend_spread,
       REGR_SYY(signups, spend) AS signup_spread
FROM weekly
GROUP BY campaign
ORDER BY campaign;

Expected from the documented formulas; not run on Snowflake by the desk: flat and line both return an R² of 1, but flat has zero signup spread and line does not. fixed has zero spend spread and returns NULL for R². For a generated dashboard summary, report “signups did not vary on the weeks analyzed” for flat, and “spend did not vary” for fixed. Keep the raw score for inspection, but don’t let it select the explanation on its own.

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.