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

advanced cumulative_sum() syntax fails in combination with derivative() #8150

Closed
gsauthof opened this issue Mar 16, 2017 · 2 comments
Closed

Comments

@gsauthof
Copy link

Bug report

System info: Influxdb 1.2.2, RHEL 6

Steps to reproduce:

select derivative(cumulative_sum(sum(events)), 1m) from measurement
    where $timeFilter group by $interval

Expected behavior: Same result as with this select statement that uses a sub-query instead of nesting:

select derivative(x, 1m) from (select cumulative_sum(sum(events)) as x
    from measurement
    where $timeFilter group by $interval)

Actual behavior:

ERR: error parsing query: expected field argument in cumulative_sum()

Additional info:

background/use-case: the events could originate from a - say - process manager that reports at irregular intervals how many processes it has started since the last time. The objective is then to get a start-rate normalized over a certain interval - here 1 minute - with varying resolution (here $interval) for varying periods (here $timeFilter).

@Tomcat-Engineering
Copy link
Contributor

Function nesting basically not supported except for a few combinations.

The documentation is not very clear on what is legal, but in general if a combination isn't mentioned in a documentation example it will probably be rejected by the query parser - though it is always worth trying things just in case they work!

I raised a more general issue for this (#7438) but the conclusion seemed to be that we should use subqueries rather than nested function calls.

@jsternberg
Copy link
Contributor

I believe the primary problem here is that cumulative_sum() does not support function nesting. I'm going to close this since using a subquery is possible instead. It doesn't appear to be a bug.

Thanks.

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

No branches or pull requests

3 participants