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
guideBIGQUERY PRACTICE

BigQuery ML.TREND can use later data to smooth a historical point

For an as-of report or backtest, apply the cutoff to the input of ML.TREND, not just to the rows it returns.

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

Ask a SQL assistant, “What did the daily sign-up trend look like as of Friday?” and it might run BigQuery’s ML.TREND on the full table, then filter the result to Friday. That produces a chart that ends on Friday, but it does not necessarily reproduce what someone could have known on Friday. The distinction follows from how BigQuery documents ML.TREND: its default smoothing window is five points, and that smoothing is centered on each historical trend point.

‘History’ describes the row, not the information available then

With a five-point centered average, an interior point uses two trend points on either side. For a daily series, that means a Friday surrounded by a full window can be smoothed using Saturday and Sunday trend points. As a toy example, if the five pre-smoothing trend values from Wednesday through Sunday were 10, 10, 10, 20 and 20, their centered average at Friday would be 14. That is arithmetic illustrating the documented window, not a measured BigQuery result or an assertion that ML.TREND averages the raw observations directly. Google distinguishes the calculated trend column from the input data column in its output schema.

Omitting horizon makes the function return historical results only. Likewise, filtering time_series_type to history keeps forecast rows out of the result. Neither action puts a cutoff on the input. Google also documents that the smoother pads the first or last value at the series boundary, so Friday at the end of a Friday-only run is not treated the same way as an interior Friday in a run that includes the weekend.

Put the cutoff where the function reads it

For a single as-of report, make the cutoff part of the table or query passed into ML.TREND. If observations can arrive late or be revised, use a snapshot or an availability timestamp that reflects what the analyst could actually have seen at that cutoff; filtering by observation date alone does not establish that. For a backtest that simulates a decision on each date, repeat the calculation with the input available at each decision date, or choose a separately validated trailing measure. A single fit through month-end should not be treated as a point-in-time feature for every day in that month.

A retrospective chart can still use centered smoothing. The practical review question is whether the user asked what the trend looks like in hindsight or what was knowable at the time. Check the input to the function, not just the dates in the final chart.

sources

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.