v.25.8New Feature

TimeSeriesDerivToGrid and timeSeriesPredictLinearToGrid aggregate functions

timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid aggregate functions to re-sample data to a time grid defined by the specified start timestamp, end timestamp, and step; calculates PromQL-like deriv and predict_linear, respectively. #84328 (Stephen Chi).
Introduces two new aggregate functions, timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid, which re-sample time series data onto a specified time grid and compute PromQL-like deriv and predict_linear operations respectively.

Why it matters

These functions address the need to analyze and predict time series data by resampling it to a uniform time grid and applying derivative and linear prediction calculations similar to Prometheus's PromQL language. This allows users to perform advanced time series analysis directly within ClickHouse for monitoring and forecasting scenarios.

How to use it

Use timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid as aggregate functions by providing the start timestamp, end timestamp, and step interval parameters to define the target time grid. They will then resample the data and apply the respective calculations automatically.