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] cannot select field names with prefix + "." that match the measurement name #3457

Closed
matwey opened this issue Jul 24, 2015 · 3 comments · Fixed by #4112
Closed

[0.9.3] cannot select field names with prefix + "." that match the measurement name #3457

matwey opened this issue Jul 24, 2015 · 3 comments · Fixed by #4112
Assignees
Milestone

Comments

@matwey
Copy link

matwey commented Jul 24, 2015

Hello,

I am running 0.9.1, and facing the following:

Connected to http://localhost:8086 version 0.9
InfluxDB shell 0.9
> create database test
> use test
Using database test
> insert foo foo.bar.baz=1,foo.bar.bar=2
> select * from foo
name: foo
---------
time                            foo.bar.bar     foo.bar.baz
2015-07-24T05:17:12.089448826Z  2               1

> select "foo.bar.baz" from foo
ERR: unknown field or tag name in select clause: foo."bar.baz"
> select foo.bar.baz from foo
ERR: unknown field or tag name in select clause: foo."bar.baz"

This is either lack of documentation and inconsistency (because if "foo.bar.bar" is illegal name, then it has not to be inserted successfully) or select-statement parser issue.

@beckettsean
Copy link
Contributor

Interestingly enough it requires two dots in the field key for this to show up:

Repro case as from @matwey

> use mydb1
Using database mydb1
> insert foo foo.bar.baz=1
> select * from foo
name: foo
---------
time                foo.bar.baz
2015-07-24T23:09:15.842965617Z  1

> select "foo.bar.baz" from foo
ERR: unknown field or tag name in select clause: foo."bar.baz"
> select foo.bar.baz from foo
ERR: unknown field or tag name in select clause: foo."bar.baz"

Can't repro with only one .

> insert foo foo.bar=1
> select * from foo
name: foo
---------
time                foo.bar foo.bar.baz
2015-07-24T23:09:15.842965617Z      1
2015-07-24T23:10:04.756877936Z  1   

> select "foo.bar" from foo
name: foo
---------
time                foo.bar
2015-07-24T23:10:04.756877936Z  1

@beckettsean
Copy link
Contributor

A single period works but multiple periods render a field unqueryable if explicitly referenced:

> insert foo foo.bar.baz=T
> select * from foo
name: foo
---------
time                foo.bar.baz
2015-08-18T23:43:49.398196253Z  true

#explicitly selecting the field returns nothing
> select "foo.bar.baz" from foo
> select foo.bar.baz from foo


# single period is fine
> insert foo foo.bar=F
> select * from foo
name: foo
---------
time                foo.bar foo.bar.baz
2015-08-18T23:43:49.398196253Z      true
2015-08-18T23:44:55.967966035Z  false   

> select "foo.bar" from foo
name: foo
---------
time                foo.bar
2015-08-18T23:44:55.967966035Z  false

# more than 2 periods leads to no results, as well:
> insert foo foo.bar.baz.bat=1234
> select * from foo
name: foo
---------
time                foo.bar foo.bar.baz foo.bar.baz.bat
2015-08-18T23:43:49.398196253Z      true        
2015-08-18T23:44:55.967966035Z  false           
2015-08-18T23:46:40.447532248Z              1234

> select "foo.bar.baz.bat" from foo
> 

@beckettsean beckettsean changed the title select dot-contaminated field names [0.9.3] cannot select field names with multiple periods Aug 18, 2015
@beckettsean beckettsean added this to the 0.9.4 milestone Aug 25, 2015
@corylanou corylanou self-assigned this Sep 11, 2015
@corylanou
Copy link
Contributor

This actually turns out to be a problem ONLY if the measurement matches the first segment of the field being asked for.

fails:

> use mydb1
Using database mydb1
> insert foo foo.bar.baz=1
> select * from foo
name: foo
---------
time                foo.bar.baz
2015-07-24T23:09:15.842965617Z  1

> select "foo.bar.baz" from foo
> select foo.bar.baz from foo

works:

> use mydb1
Using database mydb1
> insert cpu foo.bar.baz=1
> select * from cpu
name: cpu
---------
time                foo.bar.baz
2015-07-24T23:09:15.842965617Z  1

> select "foo.bar.baz" from foo
name: cpu
---------
time                foo.bar.baz
2015-07-24T23:09:15.842965617Z  1
> select foo.bar.baz from cpu
name: cpu
---------
time                foo.bar.baz
2015-07-24T23:09:15.842965617Z  1

@corylanou corylanou changed the title [0.9.3] cannot select field names with multiple periods [0.9.3] cannot select field names with prefix + "." that match the measurement name Sep 15, 2015
@corylanou corylanou modified the milestones: 0.9.5, 0.9.4 Sep 16, 2015
corylanou added a commit that referenced this issue Sep 16, 2015
Period in field name that matches measurement fails.  Fixes #3457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants