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

Cannot select fields when selecting multiple aggregates in outer query #8322

Closed
kostasb opened this issue Apr 25, 2017 · 1 comment
Closed

Comments

@kostasb
Copy link

kostasb commented Apr 25, 2017

v1.2.3

When selecting a field or tag along with multiple aggregate fields in the outer query, an error ERR: cannot select fields when selecting multiple aggregates is returned.

Repro:

> insert test,if=AGG1 input=1,output=2,speed=3
> insert test,if=AGG2 input=4,output=5,speed=6

> select I,O from (select max(input) as I,max(output) as O,max(speed) as S from test where if =~ /^AGG/ group by if)
name: test
time I O
---- - -
0    1 2
0    4 5

> select I,O,if from (select max(input) as I,max(output) as O,max(speed) as S from test where if =~ /^AGG/ group by if)
ERR: cannot select fields when selecting multiple aggregates

> select I,if from (select percentile("input",95) as I,percentile("output",95) as O,percentile("speed",95) as S from test where if =~ /^AGG/ group by if)
name: test
time                I if
----                - --
1493130907774306331 1 AGG1
1493130926117777461 4 AGG2

> select I,O,if from (select percentile("input",95) as I,percentile("output",95) as O,percentile("speed",95) as S from test where if =~ /^AGG/ group by if)
ERR: cannot select fields when selecting multiple aggregates

Works well without aggregates:

> select I,O,if from (select "input" as I,"output" as O,"speed" as S from test where if =~ /^AGG/ group by if)
name: test
time                I O if
----                - - --
1493130907774306331 1 2 AGG1
1493130926117777461 4 5 AGG2
@jsternberg
Copy link
Contributor

@benbjohnson says that #8081 fixes this.

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

2 participants