Skip to content
Advertisement

InfluxQL: tag called Group causing grief

I have to work with an influxDB database and one of the tags is called Group. For example the query select * from Testing limit 10 returns

time          Expiry     Group Parameter Type     value
----          ------     ----- --------- ----     -----
1623325196515 2021-06-18 GA011 Aleft     Combined -21.739
1623325196515 2021-06-18 GA011 Aright    Combined 0.933
1623325196515 2021-06-18 GA011 Bleft     Combined 43.097
1623325196515 2021-06-18 GA011 Bright    Combined 2.582
1623325196515 2021-06-18 GA011 Cleft     Combined 24.841
1623325196515 2021-06-18 GA011 Cright    Combined -3.444
1623325196515 2021-06-18 GA011 Dleft     Combined 12.012
1623325196515 2021-06-18 GA011 Dright    Combined 2.574
1623325196515 2021-06-18 GA011 Eleft     Combined 1.232
1623325196515 2021-06-18 GA011 Eright    Combined 15.764

The problem is when I try to have a rule based on group, e.g.

select * from Testing where Group='GA011'

I get an error that says

ERR: error parsing query: found GROUP, expected identifier, string, number, bool at line 1, char 29.

Basically it treats Group as a function not as a tag. Is there any way to escape the keyword Group and query the database.

PS. I didn’t have to do anything with the design and it cannot be changed now.

Advertisement

Answer

you can escape it using double quote:

select * from Testing where "Group"='GA011'
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement