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

Implementing rolling operations for unevenly spaced time series #8747

Open
jeffw-wherethebitsroam opened this issue Jan 20, 2020 · 1 comment
Labels

Comments

@jeffw-wherethebitsroam
Copy link

Hi,

We have time series data which is unevenly spaced. We would like to implement rolling average functions like the ones mentioned in:

https://pdfs.semanticscholar.org/882e/93570eae184ae737bf0344cb50a2925e353d.pdf

For example, a moving average with a 10 minute window and linear interpolation.

The question I have is about implementation. Looking at some of the code for similar functions (e.g. groupArrayMovingAvg) and they are all implemented as an aggregation function that return an array. Is that the right way to go?

If that is the case, what are size constraints for that array?

Thanks,
Jeff

@filimonov
Copy link
Contributor

There were some related discussions here: #4542

I think arrays is just the simplest way to archve 'good enough' results.

Other possible ideas (as an alternative to arrays)

  1. something similar to ORDER BY WITH FILL (see [WIP] WITH TIES and WITH FILL modifiers #5069 ).
  2. some special type of 'interpolating' join. ('temporal join' ?)
  3. more?

Other DBs:
https://cloud.ibm.com/docs/services/sql-query?topic=sql-query-temporal_align
https://www.vertica.com/blog/time-series-analysis-vertica/
https://blog.timescale.com/blog/sql-functions-for-time-series-analysis/
https://axibase.com/docs/atsd/sql/#interpolation

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

4 participants