live wire
▸AWS Partner Central adds plain-language analytics over MCP and daily dataset delivery to S3AWS What's New▸A real-estate SQL agent study finds nine questions its dbt marts could not answerHerman Chan / GitHub▸QueryHub’s 92 SQL queries all ran, but a 30-day default made 10 answers wrong in its SQLite testQueryHub / GitHub▸Dex v1.18.5 reports unsupported Elementary releases as unchecked; incident CLI is deferredExmergo / GitHub▸BIRD-FanOut study cuts SQL overcount errors from 18.4% to about 13% on 229 selected train questionsAhmed M. Mahran / arXiv▸dbt remote MCP lets read-only users query metrics with a shared warehouse credentialdbt Labs documentation▸SchemaGate drops unqualified BIRD Mini-Dev No. 1 claim after benchmark updateSchemaGate / GitHub▸Databricks previews AI_MASK v2 with built-in classifiers and per-row errors; v1 stays the defaultDatabricks documentation▸FedTriCD reports about 20 rounds vs F3KM’s 1,000 on MNIST; its 50× speedup was a separate centralized testNie et al. / arXiv▸BigQuery previews EmbeddingGemma 2 in AI.EMBED with per-token and query compute chargesGoogle Cloud documentation▸Fabric Warehouse previews on-demand billing with workspace queues and a rolling 24-hour capMicrosoft Fabric Updates Blog▸BigQuery makes TabFM 1.1 the default for AI.PREDICT and TabFM evaluations in AI.EVALUATEGoogle Cloud documentation▸Decision columns matched dense retrieval’s product-matching F1 with a shared verifier, but lagged in standalone searchKannan, Bruckner and Bernstein / arXiv▸BigQuery makes regional controls for reservation overrides and blocking on-demand query billing generally availableGoogle Cloud documentation▸AWS Partner Central adds plain-language analytics over MCP and daily dataset delivery to S3AWS What's New▸A real-estate SQL agent study finds nine questions its dbt marts could not answerHerman Chan / GitHub▸QueryHub’s 92 SQL queries all ran, but a 30-day default made 10 answers wrong in its SQLite testQueryHub / GitHub▸Dex v1.18.5 reports unsupported Elementary releases as unchecked; incident CLI is deferredExmergo / GitHub▸BIRD-FanOut study cuts SQL overcount errors from 18.4% to about 13% on 229 selected train questionsAhmed M. Mahran / arXiv▸dbt remote MCP lets read-only users query metrics with a shared warehouse credentialdbt Labs documentation▸SchemaGate drops unqualified BIRD Mini-Dev No. 1 claim after benchmark updateSchemaGate / GitHub▸Databricks previews AI_MASK v2 with built-in classifiers and per-row errors; v1 stays the defaultDatabricks documentation▸FedTriCD reports about 20 rounds vs F3KM’s 1,000 on MNIST; its 50× speedup was a separate centralized testNie et al. / arXiv▸BigQuery previews EmbeddingGemma 2 in AI.EMBED with per-token and query compute chargesGoogle Cloud documentation▸Fabric Warehouse previews on-demand billing with workspace queues and a rolling 24-hour capMicrosoft Fabric Updates Blog▸BigQuery makes TabFM 1.1 the default for AI.PREDICT and TabFM evaluations in AI.EVALUATEGoogle Cloud documentation▸Decision columns matched dense retrieval’s product-matching F1 with a shared verifier, but lagged in standalone searchKannan, Bruckner and Bernstein / arXiv▸BigQuery makes regional controls for reservation overrides and blocking on-demand query billing generally availableGoogle Cloud documentation
nl2sql.ai
guideSQL AGENT FIELD GUIDE

BigQuery’s LAST_VALUE can return the current status instead of the final status

For an event-history query that keeps every row, a full-partition frame and a deterministic event order make “final” explicit.

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

“Show every order event alongside the order’s final status” sounds like a job for LAST_VALUE. It is, but only if the window reaches the final event. BigQuery defines LAST_VALUE as the value from the last row in the current window frame, not the last row in the partition. Google’s window reference explicitly shows an ordered LAST_VALUE without a frame as equivalent to RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW.

Keep the event rows; widen the frame

Take a synthetic order with three events at distinct timestamps: placed, paid, then shipped. With LAST_VALUE(status) OVER (PARTITION BY order_id ORDER BY event_ts), the expected result is placed, paid, and shipped on the three respective rows. The query runs and every value looks plausible, but the column is not the final status repeated on each row. For that output, adapt the full-partition frame in Google’s example:

SELECT
  order_id,
  event_ts,
  event_id,
  status,
  LAST_VALUE(status) OVER (
    PARTITION BY order_id
    ORDER BY event_ts, event_id
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
  ) AS final_status
FROM order_events;

On that fixture, final_status should be shipped on all three rows. The example assumes event_id is a valid tie-breaker when timestamps match. If your data has a source sequence that defines which tied event happened last, use that instead; a stable sort key is not necessarily the business definition of event order.

Make a null final event a separate test

LAST_VALUE includes nulls by default. If the fixture ends with a fourth event whose status is NULL, the full-frame expression returns NULL on every row. LAST_VALUE(status IGNORE NULLS) with the same frame instead returns shipped on every row. Those are different questions: “What did the final event say?” versus “What was the last known status?”

For a SQL-agent regression test, assert both the output row count and the expected status on the first event. Checking only the last event would let the default-frame query pass the three-event case. Then add a tied timestamp and a null final event, so the test checks ordering and missing-value semantics separately from the frame. These are expected outputs derived from the documented behavior, not timings or results from a warehouse run.

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.