Databricks SQL's ai_forecast Runs Time Series Forecasts in a Single Query

Forecasting typically requires exporting data, training a model, and writing results back, which leads many teams to skip it. Databricks SQL's ai_forecast function performs the forecast within one query, and version 2 adds holiday support, covariates, and non-negative outputs on top of a time series foundation model. A step-by-step guide builds a daily sales forecast, moving from a basic run to version 2, then adding holidays, a covariate, and non-negative constraints. Testing showed the largest accuracy gain came from informing the model about planned promotions rather than from the newer model itself. The function suits regular-interval data already in a table, while custom models remain the option when more control is needed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in