-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Aggregation by time interval should respect the natural boundaries of the argument #387
Conversation
What about months and years? |
That too |
+1 for also including months and years so grouping by month includes the values between the first and the last day in that month. That would be a huuuuuuge boon. I'm currently rolling group by |
So right now what are the boundaries for 1w? On our system it gives back data between Thursdays. Is there a way to change this? |
Having similar problems when grouping by week. I would need a monday to sunday grouping when |
@toddboom is currently working on this story, I'm just commenting on the issue to let everyone know. |
35fb30b
to
a286f5f
Compare
This is almost done. I just need to clean up the test cases for month and year boundaries. (And fix some broken tests.) |
Best news I've heard all week! 👯 |
Ok, I think this guy is ready to go. The only caveat is that weeks start on Sunday now, which might be frustrating for folks who wanted it to start on Monday. Don't worry, though - I'm going to open up a new issue to make this configurable. |
@@ -12,9 +12,11 @@ import ( | |||
|
|||
// Returns the parsed duration in nanoseconds, support 'u', 's', 'm', | |||
// 'h', 'd' and 'w' suffixes. | |||
func ParseTimeDuration(value string) (int64, error) { | |||
func ParseTimeDuration(value string) (int64, bool, error) { |
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.
Can you update the documentation to explain what the extra return value means
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.
The bool
return value is also used a few times and we ignore it in most places, should this be a separate function ? Just a thought, I don't have a strong opinion
Other than my comments above, i think the pr is gtg |
cd99682
to
809d6f3
Compare
…ndaries of the argument.
809d6f3
to
6f45e7d
Compare
@toddboom @jvshahid I don't see the support for month and year grouping in the documentation. Per V 0.9.0 -"The time function takes the time interval which can be in microseconds, seconds, minutes, hours, days or weeks. To specify the units you can use the respective suffix u, s, m, h, d and w." Is this a mistake or is month and year grouping still not supported? |
@jjfazio the problem with month and year buckets is that they are not a uniform length. This would mean that some buckets would be a different size from other buckets, which may lead to misleading results. EDIT: Oops, I was a little too quick to reply here. It looks like this is addressed in the PR? |
So, is there any news on this? Has it been merged? Is it currently on hold? Is it part of the 9.3 release? What's the current status? For my team and I, we absolutely cannot use influxdb as a time series database without support for year and month grouping. Thanks in advance. EDIT: I've looked at the changelog and it says this has been released in v0.8.4-rc.1, however when trying month or year, it does not work. Example: group by time(y) returns group by time(1y) returns I'm using v0.9.2. EDIT 2: It looks like the year and month functionality was removed. What was the reasoning for this? Thank you! |
@jamhall version 0.8 and 0.9 are almost entirely different products. 0.8 was the final version of the older schema and cluster architecture. There is no month or year grouping in InfluxDB 0.9 and it is not currently on the roadmap. I'm unable to find a current open feature request for 0.9, so I encourage you to open one. |
@beckettsean oh no! I just found this. I was looking forward to doing some work with influxdb, but for my area monthly/yearly groupings are pretty critical. Is there an easy way around this, aside from writing out columns with the time dimensions that I might usually use? |
You can make queries in date range and aggregate yourself , but it is more Le mar. 18 août 2015 06:18, josepablocam notifications@github.com a
|
@josepablocam there are no simple workarounds, no. The GROUP BY clause only takes intervals of time, not explicit time boundaries, and nothing in the system equates to a month or a year, since they are irregular concepts. |
I'm on 0.9.3 and I'm trying to group by week but it seems that each grouping starts on a Thursday? Is there any way to change this behaviour to either Monday or Sunday? |
@rodxavier there is no current feature to change when 1w periods run. See #1837 for more information. |
Was this issue fixed or not? We have used influx 1.0.0.beta3 and problem still appears. Example:
returns first result as Same results are returned when instead |
when I group by time(1w). I still see week starting from Thursday . I want week to start from sunday or monday. Please let me know how to get it done. I spent 4,5 hours trying to figure out. mostly all issues retargeting here. SELECT SUM(value) FROM measurement_name WHERE time >= '2016-10-09T18:30:00Z' AND time < '2016-11-07T18:29:59Z' GROUP BY time(1w) Please reply... |
This ugly bug can be temporary fixed by adding offset into grouping by time: To get from monday: |
Thanks @radeno ... |
@radeno any idea why below query SELECT SUM(value) FROM report WHERE channel='email' And time >= '2016-11-08T18:30:00Z' AND time < '2016-11-10T07:48:50.743524Z' GROUP BY time(1h) gives time less than start time interval? for example :) |
@hariteritreee please use the influxdb@googlegroups.com mailing list for questions. We try to save GHI for feature requests and bug reports. The answer to your question is in the docs. Please review the |
minute, hour are straight forward. Grouping by 1d should make sure we bucket points between 00:00 UTC (midnight of consecutive days), 1w/7d should bucket points between consecutive mondays, etc. This story should deal with utc only, handling different timezones will be handled in a different issue.