
BigQuery ML supports a wide set of supervised, unsupervised, and time series models directly inside BigQuery using SQL, and models trained there do not have to remain inside BigQuery for serving. On the Professional Machine Learning Engineer exam, scenario questions often test which model family fits a given problem, how time series options behave in SQL, and when a team should export a trained model or register it for external serving instead of running predictions inside BigQuery.
For supervised learning, BigQuery ML covers both regression and classification workloads across several levels of model complexity:
For unsupervised learning, BigQuery ML provides k-means clustering and Principal Component Analysis (PCA). K-means discovers natural groupings in data without labeled examples, which helps with tasks such as segmenting customers based on behavior patterns or identifying similar products. PCA performs dimensionality reduction on high-dimensional data with many features, reducing the number of variables while preserving the most important information. Reducing dimensionality makes datasets easier to visualize and can improve the performance of downstream models.
For time series forecasting, BigQuery ML offers ARIMA_PLUS for standard forecasting and ARIMA_PLUS_XREG when external predictors need to be included. Both models forecast future values from historical patterns, accounting for trends and seasonality, while ARIMA_PLUS_XREG also accounts for external factors that influence the target.
The syntax and behavior of ARIMA_PLUS and ARIMA_PLUS_XREG are worth knowing in detail for the Professional Machine Learning Engineer exam. Both models are trained with a CREATE MODEL statement that specifies the model type inside an OPTIONS clause and pulls training data from a SELECT statement, but they handle input columns differently.
ARIMA_PLUS is a univariate model. It forecasts a single column using only that column's own historical values, with nothing outside the series influencing the prediction. If a query forecasts transaction quantity, past transaction quantity is the only signal the model uses. Three options define the structure of the time series:
time_series_timestamp_col points to the column holding the time points used for training, such as a date column. BigQuery uses this column to order rows in time and infer the data frequency, whether daily, weekly, or monthly.time_series_data_col points to the target column to forecast, such as transaction quantity.time_series_id_col specifies one or more identifier columns, such as country and product name. Each unique combination of those values identifies a separate time series, so a single CREATE MODEL statement trains an independent forecast for every country and product pair rather than pooling them into one series. BigQuery runs these modeling pipelines in parallel, which allows one query to cover a very large number of series at once.The SELECT statement feeding an ARIMA_PLUS model must return every column referenced in OPTIONS, including the timestamp column, the value being forecast, and any identifier columns.
ARIMA_PLUS_XREG uses the same overall CREATE MODEL, OPTIONS, and SELECT structure, but it is a multivariate model. The XREG suffix stands for external regressors, which are extra columns supplied alongside the target's history to help explain changes in the forecast value. For example, alongside date and transaction quantity, a query might include a holiday flag to explain jumps in transaction quantity that history alone would not predict, and daylight hours to provide a seasonal signal tied to day length rather than only the position of the date in the series.
Nothing in the OPTIONS clause names these external regressor columns. Any column returned by the SELECT statement that is not the timestamp column, the data column, or an ID column is treated as an external regressor automatically. Adding external predictors is therefore done simply by including them in the SELECT list.
One practical requirement separates ARIMA_PLUS_XREG from ARIMA_PLUS at prediction time. Because the model depends on those external columns, their values must also exist for the future dates being forecast. To project transaction quantity forward, the caller must supply future values for both the holiday flag and daylight hours on every forecast date.
Training a model in BigQuery ML does not lock predictions into BigQuery. The EXPORT MODEL statement exports a trained model by name to a specified Cloud Storage location, making it portable across other environments and serving platforms. Exported models preserve their learned parameters and structure, so predictions remain consistent whether run inside BigQuery or outside it.
The exported file format depends on the model type:
.bst file extension. This format works with XGBoost libraries across different programming environments.Exporting to Cloud Storage fits scenarios where teams need to deploy models to edge devices, integrate them into web applications, or run them inside batch processing pipelines outside BigQuery.
Exporting to Cloud Storage is not the only way to move a BigQuery ML model into broader serving workflows. You can also register a new or existing BigQuery ML model directly to Gemini Enterprise Agent Platform (formerly Vertex AI) Model Registry using the Google Cloud console, SQL, the bq command-line tool, or the API.
Direct registration requires no export step, so there is no need to write model artifacts out to Cloud Storage first. Once registered in Agent Platform Model Registry, the model gains versioning, appears in a single registry alongside models trained directly in Agent Platform, and can be deployed to an endpoint for online predictions.
Scenarios on the Professional Machine Learning Engineer exam often describe operational or architectural constraints that make exporting or registering a model the right choice rather than keeping inference inside BigQuery. Four sets of requirements drive that decision:
Our Professional Machine Learning Engineer course covers BigQuery ML supported models and export alongside SQL-based training workflows and Agent Platform model serving, with practice questions that drill these distinctions.