Skip to content

InfluxQL parsing error when grouping by tag named name #26216

@hiltontj

Description

@hiltontj

Problem

A user has reported the following error when performing the InfluxQL query:

Query

SELECT time, name, read_bytes, write_bytes FROM diskio GROUP BY name LIMIT 1

Error

error in InfluxQL statement: parsing error: invalid InfluxQL statement at pos 0. Parsing Error: Nom("SELECT time, name, read_bytes, write_bytes FROM diskio GROUP BY name LIMIT 1", Tag)

This is probably appropriate, but worth verifying.

When quoting the name column, which in their case, is a tag, the response structure includes the tag as a field, instead of a tag for grouping:

Query

SELECT time, \"name\", read_bytes, write_bytes FROM diskio GROUP BY \"name\" LIMIT 1

Response

{"results":[{"statement_id":0,"series":[{"name":"diskio","columns":["time","name","read_bytes","write_bytes"],"values":[[1743544020000000000,"nvme0n1",9269587968,180620936192],[1743544020000000000,"nvme0n1p1",7719936,1024],[1743544020000000000,"nvme0n1p2",5608448,139264],[1743544020000000000,"nvme0n1p3",9254359040,180620795904],[1743544020000000000,"zram0",1458176,4653056]]}]}]}

Purpose of this issue

Initially we should reproduce the above behaviour with a test.

Following that, figure out where the problem may be. It is likely due to the fact that core uses some custom logic for GROUP BY. If there is an easy fix in there we should probably make it but if not, we may revisit the work that has been done recently on GROUP BY in IOx, and whether a sync could provide a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions