Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time series functions as window functions #60555

Open
rschu1ze opened this issue Feb 29, 2024 · 1 comment
Open

Time series functions as window functions #60555

rschu1ze opened this issue Feb 29, 2024 · 1 comment
Labels

Comments

@rschu1ze
Copy link
Member

The functions in https://clickhouse.com/docs/en/sql-reference/functions/time-series-functions take the timeseries as an (horizontal) array. This is awkward.

A standard column argument won't work either as the algorithms (e.g. period detection) need to see the entire input and query execution in ClickHouse is chunked.

What may work is to re-implement the functions as window functions.

Fiddle

@bhavnajindal

@UnamedRus
Copy link
Contributor

need to see the entire input and query execution in ClickHouse is chunked.

Quite a bit of aggregate functions made in such way, that they consume whole input and keep it with little to no transformation.
Actual "compute" happens on finalization stage, where all data is finally visible in one "array".

For example windowFunnel and other sequence detection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants