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

Allow extending a series backwards? #242

Open
HomoCodens opened this issue Mar 25, 2021 · 6 comments
Open

Allow extending a series backwards? #242

HomoCodens opened this issue Mar 25, 2021 · 6 comments

Comments

@HomoCodens
Copy link
Collaborator

Currently timeseriesdb only allows storing vintages newer than any stored before. This is to prevent manipulation of the past by sandwiching new Vintages into the history.

It might however be useful in some (admittedly rare) cases to allow storing vintages that extend a series into the past i.e. if the vintage is older than any existing ones.

What are your thoughts?

@mbannert
Copy link
Owner

This is on hold for now b/c it is unclear how useful this is and how often the use case comes up. Messing with the past can also have negative effects (see also: https://en.wikipedia.org/wiki/Back_to_the_Future_Part_II) and ask for a whole battery of functions and functionality, e.g., deleting from the other end when series were mistakenly added to the past.

@omuelle
Copy link

omuelle commented Feb 22, 2023

This would be really useful for us, because it happens again and again and again that we have to store old vintages, unfortunately. I suggest we make a store_past_vintage parameter (or similar) that one explicitly has to set to TRUE to override the default behavior, which is to not allow it.

@mbannert
Copy link
Owner

mbannert commented Feb 22, 2023

I am really skeptical a flag is enough. Screwing up the past is really the worst case scenario for a time series archive. Particularly when the original source gets revised and claims the did not change anything or isn't around anymore.

To me, the need to make sure that the entire series is around in memory, i.e., the current series plus whatever is ahead is the best safety, also because it can be tested.

But then I don't have the pain @omuelle describes on a regular basis. Tough call.

@omuelle
Copy link

omuelle commented Feb 22, 2023

Then what about a separate function? We need the functionality anyway, it's just a matter of where to put it.

@HomoCodens
Copy link
Collaborator Author

HomoCodens commented Feb 22, 2023

@omuelle Are you talking about simply appending "in the other direction" or also inserting vintages at arbitrary points?
The former is probably of less concern in terms of "changing history".

I think such functionality should certainly only be available to timeseries admins.
Maybe you could rework the check at https://github.com/mbannert/timeseriesdb/blob/main/inst/sql/create_functions_ts.sql#L33 to be skipped if 1) the current user is an admin and 2) they specifically opt in with a parameter

@omuelle
Copy link

omuelle commented Feb 24, 2023

At arbitrary points. Basically whenever a user/process fails to write vintages, but we still have them, e.g. in another schema, on the disc or at the data provider.

Admins only sounds like a good idea.

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

No branches or pull requests

3 participants