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

SELECT with regex for measurement name somewhat ignores string valued measurements #8858

Closed
theodiefenthal opened this issue Sep 20, 2017 · 1 comment
Assignees
Labels
area/influxql Issues related to InfluxQL query language

Comments

@theodiefenthal
Copy link
Contributor

Bug report

System info: Most recent docker-compose Influx TICK stack, thus Influx 1.3.5. Operating System: Windows 10. Runs a Ubuntu in VirtualBox which in turns runs docker-compose TICK stack. Bugreport from Influx-CLI execution. But reproduced with calls to REST API directly.

Steps to reproduce:

Create a set of dummy measurements in line protocol and import them to influxdb:

# DDL
CREATE DATABASE propertytest
# CREATE RETENTION POLICY oneday ON propertytest DURATION 1d REPLICATION 1
#
# DML
# CONTEXT-DATABASE: propertytest
# CONTEXT-RETENTION-POLICY: autogen
#
#
# 
# 2017-01-01T00:00:00Z
node_1_flaeche value=42 1483228800000000000
# 
# 2017-06-01T00:00:00Z
node_1_flaeche value=100 1496275200000000000
# 
# 
# 2017-03-01T00:00:00Z
node_2_vorwiderstand value=83 1488326400000000000
# 
# 
# 2017-01-01T00:00:00Z
node_3_flaeche value=33 1483228800000000000
# 
# 2017-07-01T00:00:00Z
node_3_flaeche value=42 1498867200000000000
# 
# 
# 2016-01-01T00:00:00Z
node_4_flaeche value=22 1451606400000000000
#
#
# 2017-01-01T11:11:11Z
node_5_name value="Arthur Woll Haus" 1483269071000000000
#
#
# 2017-11-11T11:11:11Z
node_5_name value="Hans Rüdiger Eßmann Gedenkstätte" 1510398671000000000

and

influx -import -path=/propertydummytest.lineprotocol

Now query on that data using regular expressions for measurement names like so:

SELECT * FROM /.*/

Expected behavior:
An output containing all measurements with all values. (Just a dump from my database). Like so:

name: node_1_flaeche
time                value
----                -----
1483228800000000000 42
1496275200000000000 100

name: node_2_vorwiderstand
time                value
----                -----
1488326400000000000 83

name: node_3_flaeche
time                value
----                -----
1483228800000000000 33
1498867200000000000 42

name: node_4_flaeche
time                value
----                -----
1451606400000000000 22

**name: node_5_name
time                value
----                -----
1483269071000000000 Arthur Woll Haus
1510398671000000000 Hans Rüdiger Eßmann Gedenkstätte**

Actual behavior:

I get all measurement without the one having string fields:

name: node_1_flaeche
time                value
----                -----
1483228800000000000 42
1496275200000000000 100

name: node_2_vorwiderstand
time                value
----                -----
1488326400000000000 83

name: node_3_flaeche
time                value
----                -----
1483228800000000000 33
1498867200000000000 42

name: node_4_flaeche
time                value
----                -----
1451606400000000000 22

Additional info:

Interestingly, if my regular expression matches only the measurement with the string valued field, it matches:

> SELECT * FROM /node_5.*/
name: node_5_name
time                value
----                -----
1483269071000000000 Arthur Woll Haus
1510398671000000000 Hans Rüdiger Eßmann Gedenkstätte

But if it contains different valued fields, it just doesn't include the string one:

> SELECT * FROM /node_[345].*/
name: node_3_flaeche
time                value
----                -----
1483228800000000000 33
1498867200000000000 42

name: node_4_flaeche
time                value
----                -----
1451606400000000000 22
@rbetts rbetts added area/influxql Issues related to InfluxQL query language backlog/storage proposed labels Sep 21, 2017
@jsternberg
Copy link
Contributor

So it looks like this is because you have multiple measurements and the measurements have the same field value, but the types are different. InfluxQL only allows a field to have one type and it will choose one and drop types that can't be cast to the type. The priority is float, integer, string, and then boolean. So in this case, it would drop the string values.

This is working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxql Issues related to InfluxQL query language
Projects
None yet
Development

No branches or pull requests

4 participants