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

Fix group by time intervals #4038

Merged
merged 2 commits into from
Sep 8, 2015
Merged

Fix group by time intervals #4038

merged 2 commits into from
Sep 8, 2015

Conversation

corylanou
Copy link
Contributor

We were not properly setting seek/max bounds on cursors of partial buckets at the beginning and end of a tmax/tmin bucket.

The issue is best illustrated by looking at the added tests.

fixes #3926

@@ -211,11 +211,14 @@ func (q *QueryExecutor) ExecuteQuery(query *influxql.Query, database string, chu
func (q *QueryExecutor) PlanSelect(stmt *influxql.SelectStatement, chunkSize int) (Executor, error) {
shards := map[uint64]meta.ShardInfo{} // Shards requiring mappers.

// It is important to "stamp" this time so that everywhere we evaluate `now()` in the statement is EXACTLY the same `now`
now := time.Now().UTC()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change wasn't required, but it made sense that any time we use now it's the exact now everywhere.

@otoolep
Copy link
Contributor

otoolep commented Sep 8, 2015

Some important fixes, nice, +1.

corylanou added a commit that referenced this pull request Sep 8, 2015
@corylanou corylanou merged commit dea5814 into master Sep 8, 2015
@corylanou corylanou deleted the issue-3926 branch September 8, 2015 19:26
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.

[0.9.3] First or last value of GROUP BY time(x) is often null
2 participants