Skip to content

Conversation

thatzopoulos
Copy link
Contributor

Moved interpolation functions for average, delta, and rate out of the toolkit_experimental schema. Tests now check that the output of these functions match the output of the new toolkit_experimental.interpolated_* versions from this PR.

@thatzopoulos
Copy link
Contributor Author

Open to suggestions on what to call intervalparam since we can't call it interval anymore


crate::functions_stabilized_at! {
STABLE_FUNCTIONS
"1.13.0" => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marked this as stable in 1.13.0 since it is not going in the upcoming release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not going into the upcoming release (we can actually discuss this since we pushed the release out to next week), shouldn't this be marked as stable in 1.14.0?

@davidkohn88
Copy link
Contributor

Open to suggestions on what to call intervalparam since we can't call it interval anymore

Why can't we call it interval anymore? I think you just need to add double quotes around the name in your SQL and it'll work just fine.

@davidkohn88
Copy link
Contributor

One thing I'd like to do is a) write a short readme that codifies our decision about when we are doing the keep the experimental version around for one release thing and b) add a comment that these will be removed in the next release and mentions the readme.

The readme could be something like this:

We decided that when we are stabilizing accessors that have no changes from their current function signatures we are going  to move the function to the public schema and stabilize but also re-create the version in the experimental schema and keep it around for one version. 

We are doing this because some people may have started using experimental accessors in their code and this gives them a version to update their code without it breaking. We are not going to do this when we are stabilizing a full function family but only for accessors that work on already stabilized function families, these type of accessors are safer to use in production settings as their is little risk that something will be stored in, say, a continuous aggregate that would break, and we'd like to encourage people to use them and not cause unnecessary breakage pain when possible. 

We will only keep them around for one version however so they will have a limited time to update their code and not continue using things in the experimental schema indefinitely. 

@epgts does that capture what we discussed reasonably well?

@thatzopoulos thatzopoulos reopened this Dec 9, 2022
Copy link
Contributor

@WireBaron WireBaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you were looking for a review yet since this is still marked as draft, but added a few comments for you.

summary: CounterSummary<'a>,
start: crate::raw::TimestampTz,
interval: crate::raw::Interval,
intervalparam: crate::raw::Interval,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe duration or perhaps interval_len (general suggestion for all params with this name).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to duration

// Public facing interpolated_delta
extension_sql!(
"\n\
CREATE FUNCTION toolkit_experimental.interpolated_delta(summary countersummary, start timestamptz, intervalparam interval, prev countersummary, next countersummary) RETURNS double precision AS $$\n\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see this indented and perhaps separated a bit to make it more readable. You can use the extension_sql blocks we use for CREATE AGGREGATE as a guide.

"1.13.0" => {
interpolated_average(timeweightsummary,timestamp with time zone,interval,timeweightsummary,timeweightsummary),
interpolated_delta(countersummary,timestamp with time zone,interval,countersummary,countersummary),
interpolated_rate(countersummary,timestamp with time zone,interval,countersummary,countersummary),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent these to be consistent with the following blocks.


crate::functions_stabilized_at! {
STABLE_FUNCTIONS
"1.13.0" => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not going into the upcoming release (we can actually discuss this since we pushed the release out to next week), shouldn't this be marked as stable in 1.14.0?

@thatzopoulos thatzopoulos marked this pull request as ready for review December 12, 2022 20:13
@thatzopoulos thatzopoulos force-pushed the th/stabilize-some-interpolated-functions branch 2 times, most recently from ffac152 to fd834d4 Compare December 13, 2022 17:41
@thatzopoulos thatzopoulos force-pushed the th/stabilize-some-interpolated-functions branch from b89ac62 to 48decc1 Compare February 6, 2023 19:25
@thatzopoulos
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 6, 2023

@bors bors bot merged commit d3b1fe1 into main Feb 6, 2023
@bors bors bot deleted the th/stabilize-some-interpolated-functions branch February 6, 2023 19:55
nbraem added a commit to nbraem/docs that referenced this pull request Jul 23, 2024
billy-the-fish added a commit to timescale/docs that referenced this pull request Aug 1, 2024
billy-the-fish added a commit to timescale/docs that referenced this pull request Aug 1, 2024
billy-the-fish added a commit to timescale/docs that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants