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

Query returns just ERR if the subquery GROUPs BY both a time interval and a tag #7968

Closed
rossmcdonald opened this issue Feb 8, 2017 · 1 comment
Assignees
Milestone

Comments

@rossmcdonald
Copy link
Contributor

Steps to reproduce:

  1. Write some data
> insert giraffes,name=chrono leaves_consumed=12 1485298440000000000
> insert giraffes,name=graf leaves_consumed=8 1485298440000000000
> insert giraffes,name=chrono leaves_consumed=13 1485298445000000000
> insert giraffes,name=graf leaves_consumed=2 1485298445000000000
> insert giraffes,name=chrono leaves_consumed=15 1485298450000000000
> insert giraffes,name=graf leaves_consumed=4 1485298450000000000
> insert giraffes,name=chrono leaves_consumed=13 1485298455000000000
> insert giraffes,name=graf leaves_consumed=5 1485298455000000000

> select * from giraffes
name: giraffes
time                 leaves_consumed name
----                 --------------- ----
2017-01-24T22:54:00Z 12              chrono
2017-01-24T22:54:00Z 8               graf
2017-01-24T22:54:05Z 13              chrono
2017-01-24T22:54:05Z 2               graf
2017-01-24T22:54:10Z 15              chrono
2017-01-24T22:54:10Z 4               graf
2017-01-24T22:54:15Z 13              chrono
2017-01-24T22:54:15Z 5               graf
  1. Run a query where the subquery's GROUP BY clause includes a time interval and tag
> SELECT * FROM (SELECT MEAN("leaves_consumed") FROM "giraffes" WHERE time >= '2017-01-24T22:54:00Z' AND time <= '2017-01-24T22:54:15Z' GROUP BY time(10m),"name")

ERR:

Expected behavior:

I'd expect to get either this:

name: giraffes
tags: name=chrono
time                 mean
----                 ----
2017-01-24T22:50:00Z 13.25

name: giraffes
tags: name=graf
time                 mean
----                 ----
2017-01-24T22:50:00Z 4.75

Or this:

name: giraffes
time                 mean   name
----                 ----   ----
2017-01-24T22:50:00Z 13.25  chrono
2017-01-24T22:50:00Z 4.75   graf

Actual behavior:

I get ERR:.

Pulled from #7875.

@jsternberg
Copy link
Contributor

Fixed via #8051.

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

3 participants