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

influxql: when using derivative, check 'group by time' instead of 'where time ...' #4149

Merged
merged 1 commit into from
Sep 30, 2015

Conversation

peekeri
Copy link
Contributor

@peekeri peekeri commented Sep 17, 2015

Proposed fix for #4148.

When using derivative, it is required that aggregate function is used as
sub-call when grouping by time is used. However, AST parsing used to check
if WHERE-clause contained condition with 'time'.

Fix this by changing check to see if groupByInterval is present.

@beckettsean
Copy link
Contributor

@dgnorton

@otoolep
Copy link
Contributor

otoolep commented Sep 17, 2015

Thanks for the PR @peekeri -- you can see the test failures here:

https://circle-artifacts.com/gh/influxdb/influxdb/5960/artifacts/0/tmp/circle-artifacts.tXeSyhP/test_logs.txt

Please be sure to run 'go test ./...' after you've made your changes, so you can see which tests need updating.

@peekeri
Copy link
Contributor Author

peekeri commented Sep 17, 2015

@otoolep, yep I noticed the tests are failing. I didn't change them as they are failing because of the changed logic in ast.go and I wanted to see if that seems like a reasonable thing to do. I'll fix the tests anyway.

…ere time ...'

When using derivative, it is required that aggregate function is used as
sub-call when grouping by time is used. However, AST parsing used to check
if WHERE-clause contained condition with 'time'.

Fix this by changing check to see if groupByInterval is present.

Modify also related error case tests and add check for
select derivative(...) ... where time > ...
@peekeri
Copy link
Contributor Author

peekeri commented Sep 18, 2015

Fixed the failing tests and added one for accepting time condition in WHERE-clause.

@otoolep
Copy link
Contributor

otoolep commented Sep 24, 2015

Bump @dgnorton @jwilder

jwilder added a commit that referenced this pull request Sep 30, 2015
influxql: when using derivative, check 'group by time' instead of 'where time ...'
@jwilder jwilder merged commit 6dcd8d7 into influxdata:master Sep 30, 2015
@peekeri peekeri deleted the derivative_fix branch October 8, 2015 09: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.

None yet

5 participants