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

[0.9.3] (regression) cannot use GROUP BY * with more than a single field in SELECT clause #3978

Closed
beckettsean opened this issue Sep 3, 2015 · 3 comments
Assignees
Milestone

Comments

@beckettsean
Copy link
Contributor

Using GROUP BY * with more than a single field in the SELECT clause leads to ERR: error parsing query: wildcards can not be combined with other fields

> insert groupbystar,foo=a,bar=b value1=1,value2=2
> insert groupbystar,foo=a,bar=b value1=2,value2=3
> insert groupbystar,foo=c,bar=d value1=2,value2=3
> insert groupbystar,foo=c,bar=b value1=2,value2=3
> insert groupbystar,foo=a,bar=d value1=2,value2=3
> select * from groupbystar
name: groupbystar
-----------------
time                bar foo value1  value2
2015-09-03T20:37:47.443429272Z  b   a   1   2
2015-09-03T20:37:51.916076836Z  b   a   2   3
2015-09-03T20:37:57.515262942Z  d   c   2   3
2015-09-03T20:38:00.755724348Z  b   c   2   3
2015-09-03T20:38:06.005256776Z  d   a   2   3

> select value1 from groupbystar group by *
name: groupbystar
tags: bar=b, foo=a
time                value1
----                ------
2015-09-03T20:37:47.443429272Z  1
2015-09-03T20:37:51.916076836Z  2


name: groupbystar
tags: bar=b, foo=c
time                value1
----                ------
2015-09-03T20:38:00.755724348Z  2


name: groupbystar
tags: bar=d, foo=a
time                value1
----                ------
2015-09-03T20:38:06.005256776Z  2


name: groupbystar
tags: bar=d, foo=c
time                value1
----                ------
2015-09-03T20:37:57.515262942Z  2

All good to this point. Now add a GROUP BY * and the problem shows up.

> select value1, value2 from groupbystar group by *
ERR: error parsing query: wildcards can not be combined with other fields

The error happens whether the additional column is a field, as above, or a tag, as follows:

> select value1, foo from groupbystar
name: groupbystar
-----------------
time                value1  foo
2015-09-03T20:37:47.443429272Z  1   a
2015-09-03T20:37:51.916076836Z  2   a
2015-09-03T20:37:57.515262942Z  2   c
2015-09-03T20:38:00.755724348Z  2   c
2015-09-03T20:38:06.005256776Z  2   a

> select value1, foo from groupbystar group by *
ERR: error parsing query: wildcards can not be combined with other fields
@beckettsean
Copy link
Contributor Author

Verified this is a regression from the 0.9.2 behavior:

Recreating the setup:

# /opt/influxdb/influx
Connected to http://localhost:8086 version 0.9.2
InfluxDB shell 0.9.2
> insert groupbystar,foo=a,bar=b value1=1,value2=2
> insert groupbystar,foo=a,bar=b value1=2,value2=3
> insert groupbystar,foo=c,bar=d value1=2,value2=3
> insert groupbystar,foo=c,bar=b value1=2,value2=3
> insert groupbystar,foo=a,bar=d value1=2,value2=3

> select value1 from groupbystar group by *
name: groupbystar
tags: bar=b, foo=a
time                value1
----                ------
2015-09-03T21:00:47.922913036Z  1
2015-09-03T21:00:48.932354785Z  2


name: groupbystar
tags: bar=b, foo=c
time                value1
----                ------
2015-09-03T21:00:48.948738908Z  2


name: groupbystar
tags: bar=d, foo=a
time                value1
----                ------
2015-09-03T21:00:48.952499392Z  2


name: groupbystar
tags: bar=d, foo=c
time                value1
----                ------
2015-09-03T21:00:48.940885822Z  2

Selecting more than one column while including GROUP BY * works:

> select value1, value2 from groupbystar group by *
name: groupbystar
tags: bar=b, foo=a
time                value1  value2
----                ------  ------
2015-09-03T21:00:47.922913036Z  1   2
2015-09-03T21:00:48.932354785Z  2   3


name: groupbystar
tags: bar=b, foo=c
time                value1  value2
----                ------  ------
2015-09-03T21:00:48.948738908Z  2   3


name: groupbystar
tags: bar=d, foo=a
time                value1  value2
----                ------  ------
2015-09-03T21:00:48.952499392Z  2   3


name: groupbystar
tags: bar=d, foo=c
time                value1  value2
----                ------  ------
2015-09-03T21:00:48.940885822Z  2   3



> select value1, foo from groupbystar group by *
name: groupbystar
tags: bar=b, foo=a
time                value1
----                ------
2015-09-03T21:00:47.922913036Z  1
2015-09-03T21:00:48.932354785Z  2


name: groupbystar
tags: bar=b, foo=c
time                value1
----                ------
2015-09-03T21:00:48.948738908Z  2


name: groupbystar
tags: bar=d, foo=a
time                value1
----                ------
2015-09-03T21:00:48.952499392Z  2


name: groupbystar
tags: bar=d, foo=c
time                value1
----                ------
2015-09-03T21:00:48.940885822Z  2

> 

@beckettsean beckettsean changed the title [0.9.3] cannot use GROUP BY * with more than a single field in SELECT clause [0.9.3] (regression) cannot use GROUP BY * with more than a single field in SELECT clause Sep 3, 2015
@beckettsean
Copy link
Contributor Author

@corylanou regression from the GROUP BY * changes?

@corylanou
Copy link
Contributor

Yeah, that doesn't look right. I think we are getting close to making that work for real now so maybe we should see if it's easier just to complete the functionality rather than fix the bug the stop gap introduced.

@beckettsean beckettsean added this to the 0.9.4 milestone Sep 8, 2015
corylanou added a commit that referenced this issue Sep 10, 2015
Allow wildcards with fields! Fixes #3978
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

2 participants