Conversation
6882a6f to
daefd4b
Compare
syvb
commented
Sep 9, 2022
| agg, | ||
| bucket, | ||
| '1 day'::interval, | ||
| LAG(agg) OVER (ORDER BY bucket), |
Contributor
Author
There was a problem hiding this comment.
I removed the trailing whitespace here for consistency with the similar SQL for getting the integrals.
daefd4b to
6aad8a4
Compare
6aad8a4 to
9477a59
Compare
rtwalker
reviewed
Sep 15, 2022
59ec1aa to
2ce21ce
Compare
2ce21ce to
bfdda22
Compare
rtwalker
approved these changes
Sep 16, 2022
Contributor
rtwalker
left a comment
There was a problem hiding this comment.
Thanks for the changes! Looks good to me though I'd wait for someone else to weigh in :)
WireBaron
approved these changes
Sep 19, 2022
Contributor
Author
|
bors r+ |
Contributor
|
Build succeeded: |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements functionality requested in #455:
integral(tws[, unit]) -> float8function (unit defaults to'second')interpolated_integral(tws, start, interval, prev, next[, unit]) -> float8function (unit defaults to'second')integral/interpolated_integraltrapezoidalan alias forlinearin thetime_weightfunctionThe
unitparameter tointegral/interpolated_integralis a string that specifies what time unit to use for the returnedf64. It can be any fixed-duration unit that PostgreSQL allows in ainterval. An alternative would be to have anintervalbe passed as the unit instead, butintervals can have variable length units (days and months) which might not be wanted. Also,integral(..., 'hour')is clearer thanintegral(..., '1 hour'::interval).