-
Notifications
You must be signed in to change notification settings - Fork 116
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
Fix prev/next expression examples #3637
base: latest
Are you sure you want to change the base?
Conversation
Hi @intermittentnrg, thanks for this work. Is this PR still a draft or are you ready for review? Iain |
Ready for review. I tested & used the updated queries. But in the end couldn't use prev expression because there were no datapoints in queried range and prev expression is only used for datapoints within range. |
Thanks @intermittentnrg , much appreciated. |
@@ -75,17 +75,19 @@ to fill gaps at the beginning of the queried time range. Note that the | |||
|
|||
```sql | |||
SELECT time_bucket_gapfill('1 day', time) AS day, | |||
device_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add this to the group by
clause too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good point. GROUP BY device_id, day
.
device_id should be either in GROUP BY or WHERE to make query realistic.
LIMIT 1 | ||
) | ||
) as value | ||
FROM metrics | ||
FROM metrics m | ||
WHERE time > '2021-12-31 00:00:00+00'::timestamptz | ||
AND time < '2022-01-10 00:00:00-00'::timestamptz | ||
GROUP BY day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GROUP BY day | |
GROUP BY day, device_id |
LIMIT 1 | ||
) | ||
) as value | ||
FROM metrics | ||
FROM metrics m | ||
WHERE time > '2021-12-31 00:00:00+00'::timestamptz | ||
AND time < '2022-01-10 00:00:00-00'::timestamptz | ||
GROUP BY day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GROUP BY day | |
GROUP BY day, device_id |
Description
[Short summary of why you created this PR]
Links
Fixes #[insert issue link, if any]
Writing help
For information about style and word usage, see the style guide
Review checklists
Reviewers: use this section to ensure you have checked everything before approving this PR:
Subject matter expert (SME) review checklist
Documentation team review checklist
and have they been implemented?