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
guideQUERY CORRECTNESS

Filling a missing value with zero can reverse the sign of Snowflake covariance

In a three-row test for generated SQL, an unreported sales figure turns positive covariance negative if the query treats the missing figure as an observed zero.

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

Ask a SQL assistant whether stores with more demo sessions also tend to record more sales. If one store's sales feed hasn't arrived, the right answer is not to count that store as having sold nothing. In a three-row example, that single substitution reverses the sign of the sample covariance, making a positive result look negative.

Test the difference between missing and zero

Suppose three stores held one, three and five demos on the same day. The first two reported one and three sales; the third has not reported. Snowflake’s COVAR_SAMP uses only pairs with both values present. Wrapping sales in COALESCE(sales, 0) changes the input: the five-demo store enters the calculation as a store with zero sales.

WITH store_day AS (
    SELECT column1 AS demos, column2 AS sales
    FROM VALUES (1, 1), (3, 3), (5, NULL)
)
SELECT COUNT(*) AS stores_in_scope,
       COUNT(demos, sales) AS complete_pairs,
       COVAR_SAMP(sales, demos) AS reported_pair_covariance,
       COVAR_SAMP(COALESCE(sales, 0), demos) AS zero_filled_covariance
FROM store_day;

Expected results from the documented formula, not a live Snowflake run: 3 stores, 2 complete pairs, +2 using reported pairs and −1 after zero-filling. COUNT(*) counts all rows; COUNT(demos, sales) counts only rows where both values are present. An observed zero is already a non-null value, so it belongs in both the complete-pair count and the covariance without any replacement.

What the assistant should report

Ask for the covariance of reported pairs, the number of complete pairs and the number of stores in scope. Give the assistant two test cases: one with the last sale missing and another with a confirmed zero. The complete-pair count should rise from two to three only in the confirmed-zero case, and the reported-pair covariance should then change from +2 to −1. If the agent gives the same answer for both cases, inspect the SQL and the upstream metric definition for a default to zero.

Treat the example as a query test, not as evidence about store performance. Neither calculation tells you what the third store sold while its feed was missing.

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.