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

Aggregate Selectors overwrite values during post-processing #4360

Closed
syepes opened this issue Oct 7, 2015 · 5 comments
Closed

Aggregate Selectors overwrite values during post-processing #4360

syepes opened this issue Oct 7, 2015 · 5 comments
Assignees
Milestone

Comments

@syepes
Copy link

syepes commented Oct 7, 2015

Hello,

I have just encountered a strange behavior when using the aggregate functions MAX and MIN together in the same query, as we can observe in the below example the result of the MAX function is the same as the MIN.

Anyone know why is the happening?

Query:

SELECT MAX(value), MIN(value), COUNT(value) FROM "cpu_coreUtilization_average-percent" WHERE time >= now() - 2h AND instance = 'avg' AND "server" = 'xxx' GROUP BY time(30m), "server"

Query with both MAX & MIN:

name: cpu_coreUtilization_average-percent
tags: server=xxx
time                    max     min     count
----                    ---     ---     -----
1444235400000000000     3817    3817    38
1444237200000000000     3638    3638    90
1444239000000000000     3569    3569    90
1444240800000000000     3665    3665    90
1444242600000000000     3771    3771    23

Query with only MIN:

name: cpu_coreUtilization_average-percent
tags: server=xxx
time                    min     count
----                    ---     -----
1444235400000000000     3817    38
1444237200000000000     3638    90
1444239000000000000     3569    90
1444240800000000000     3665    90
1444242600000000000     3771    23

Query with only MAX:

name: cpu_coreUtilization_average-percent
tags: server=xxx
time                    max     count
----                    ---     -----
1444235400000000000     7884    38
1444237200000000000     8377    90
1444239000000000000     8412    90
1444240800000000000     8564    90
1444242600000000000     8448    23
@beckettsean
Copy link
Contributor

I cannot repro with 0.9.4.1. @syepes what version are you running?

> select max(value), min(value) from cpu_idle where time > now() - 1w group by time(1d), cpu fill(0)
name: cpu_idle
tags: cpu=cpu-total
time            max     min
----            ---     ---
2015-09-30T00:00:00Z    478281.7265625  476305.3046875
2015-10-01T00:00:00Z    567204.4140625  478323.65625
2015-10-02T00:00:00Z    678420.8828125  14873.2265625
2015-10-03T00:00:00Z    29084.9765625   17993.3125
2015-10-04T00:00:00Z    0       0
2015-10-05T00:00:00Z    161360.3515625  29301.0234375
2015-10-06T00:00:00Z    335909.984375   161399.5
2015-10-07T00:00:00Z    496257.3125 335952.5625


name: cpu_idle
tags: cpu=cpu0
time            max     min
----            ---     ---
2015-09-30T00:00:00Z    53046.75    52821.1015625
2015-10-01T00:00:00Z    63220.21875 53051.609375
2015-10-02T00:00:00Z    75731.2265625   1696.40625
2015-10-03T00:00:00Z    3353.6484375    2058.8515625
...

@syepes
Copy link
Author

syepes commented Oct 8, 2015

@beckettsean Sorry, I forget to mention the version. I am running the last master version 4c64c79 using the tsm1 SE on FreeBSD 10.2

@otoolep otoolep added this to the 0.9.5 milestone Oct 8, 2015
@beckettsean beckettsean changed the title Aggregation functions: MAX and MIN strange behaviour [0.9.5 nightly] Aggregation functions: MAX and MIN strange behaviour Oct 8, 2015
@jwilder
Copy link
Contributor

jwilder commented Oct 9, 2015

I can reproduce this with both tsm1 and bz1 engines on master so this doesn't seem to be an issue caused by the new engine.

@corylanou
Copy link
Contributor

I suspect this happened on one of my PR's to introduce selecting of fields with selector style functions. I can take a look today.

@corylanou corylanou reopened this Oct 9, 2015
@corylanou corylanou changed the title [0.9.5 nightly] Aggregation functions: MAX and MIN strange behaviour Aggregate Selectors overwrite values during post-processing Oct 9, 2015
@corylanou corylanou self-assigned this Oct 9, 2015
@syepes
Copy link
Author

syepes commented Oct 13, 2015

Thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants