Skip to content

Implement timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid#84328

Merged
vitlibar merged 8 commits intoClickHouse:masterfrom
stephchi0:implement-linear-regression-time-series-aggregation-functions
Aug 6, 2025
Merged

Implement timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid#84328
vitlibar merged 8 commits intoClickHouse:masterfrom
stephchi0:implement-linear-regression-time-series-aggregation-functions

Conversation

@stephchi0
Copy link
Copy Markdown
Contributor

@stephchi0 stephchi0 commented Jul 23, 2025

Aggregate functions timeSeriesDerivToGrid and timeSeriesPredictLinearToGrid.
Behaves similarly to timeSeriesRateToGrid, accepting parameters for start timestamp, end timestamp, step, and look back window (predict_linear accepting an additional predict_offset parameter), as well as two arguments for the timestamps and values.
Returns a derivative or prediction value using least-square linear regression, calculated on samples in the specified window for each timestamp in the time grid defined by the parameters. The return type is Array(Nullable(Float64)).

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

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.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 23, 2025

CLA assistant check
All committers have signed the CLA.

@bharatnc bharatnc added the can be tested Allows running workflows for external contributors label Jul 23, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jul 23, 2025

Workflow [PR], commit [10651a6]

@clickhouse-gh clickhouse-gh bot added the pr-feature Pull request with new product feature label Jul 23, 2025
…se Float64 for DateTime64 predict_linear case, update FORMAT_VERSION
@vitlibar
Copy link
Copy Markdown
Member

vitlibar commented Aug 6, 2025

@vitlibar vitlibar enabled auto-merge August 6, 2025 12:40
@vitlibar vitlibar added this pull request to the merge queue Aug 6, 2025
Merged via the queue into ClickHouse:master with commit 07bcfab Aug 6, 2025
120 of 124 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants